Why does a flat universe imply an infinite universe? This article claims that because the universe appears to be flat, it must be infinite. I've heard this idea mentioned in a few other places, but they never explain the reasoning at all. 
 A: I think that it is important to note that (almost) everyone doing cosmology works within the framework of the FLRW universe. 
This implies that we assume that the universe is spatially homogeneous and isotropic, i.e. 'every place is the same (at least on large scales)'. Now, think of a flat, finite universe: Is it possible to maintain that all places are the same?
A: We need to be precise about the phrase the size of the universe. Specifically I'm going to take it to mean the maximum possible separation between any two points. In an infinite universe two points can be separated by an arbitrarily large distance, so if the maximum distance between two points is finite this means the universe must not be infinite.
The point of all this is that the distance between any two points is calculated using the metric. For a Friedmann universe like ours (at least we believe our universe to be a Friedmann universe) the metric is (in polar coordinates):
$$ ds^2 = -dt^2 + a^2(t) \left[ \frac{dr^2}{1 - kr^2} + r^2d\Omega^2 \right] $$
The value of the parameter $k$ determines whether the universe is closed, flat or open. Specifically $k > 0$ is a closed universe, $k = 0$ is a flat universe and $k < 0$ is an open universe. The variable $s$ is the proper distance.
Now, suppose we choose an origin at some starting point, choose a fixed time, and calculate the proper distance, $s$ as we move radially away from the starting point. The question is whether $s$ can reach infinity or not. Because only $r$ is changing $dt = d\Omega = 0$, so the expression for the proper distance simplifies to:
$$ ds^2 = a^2(t) \frac{dr^2}{1 - kr^2} $$
We'll choose our units of distance to make $a = 1$, and we'll consider only closed or flat space, $k \ge 0$, in which case we can integrate the above equation to give:
$$ s(r) = \frac{\sin^{-1}(\sqrt{k}r)}{\sqrt{k}} $$
So the maximum possible value for $s(r)$ is when $\sqrt{k}r = 1$, in which case:
$$ s_{max} = \frac{\pi}{2\sqrt{k}} $$
And there's the result we want. For a closed universe $k > 0$ and therefore the maximum possible distance between two points is finite. However as $k \rightarrow 0$ the maximum possible distance $s_{max} \rightarrow\infty$. That's why a flat universe is infinite.
However we should note that, As Rexcirus points out in his answer, even a flat universe can be finite if it has a non-trivial topology.
A: Other answers have made clear the 'flat' only implies infinite given additional assumptions around the topology. 
In short: A universe which is the same everywhere but not simply connected can be finite.
It's worth mentioning that whilst the main working model assumes that the universe is simply connected, the actual topology is an open and serious question.
Consequently there are ongoing studies on firstly the topological possibilities and secondly looking for them.
For example, the next simplest space would be a 3-torus. With that shape, and a sufficiently small universe, you might be able to see the same galaxies by looking in opposite directions in the sky.
[ As far as I am aware ] There is no hard evidence for such galaxy mirroring.
As a jumping off point, see Wikipedia Doughnut Universe, but there are also a load of technical papers on the subject.
A: The claim that "because the universe appears to be flat, it must be infinite" is very wrong. Not only is the conclusion not supported by the premise, it suggests a misunderstanding of the nature of science.
We're in a boat floating on an ocean. We can only see a finite distance in every direction. For as far as we can see, there is nothing but smooth ocean, with no perceptible curvature.
All of the following are consistent with what we see:

*

*The universe is an infinite planar ocean.

*The universe is a sphere covered with ocean, with a radius large enough that the part we can see has no detectable curvature.

*The universe is an infinite hyperbolic-planar ocean, with a curvature small enough that we can't detect it.

*The universe is an ocean that isn't uniformly curved, but the curvature everywhere, or at least in our neighborhood, is small enough that we can't detect it.

*The universe contains both oceans and dry land, and we're in the middle of an ocean large enough that we can't see the shores.

This doesn't exhaust the possibilities. All of these models are not only possible, but seem fairly plausible, given what we see.
Given the data, scientists on the boat will most likely model the ocean as an infinite plane. This doesn't mean that they believe it's an infinite plane. There's just no sense in using a more complicated model in the absence of any data to settle the question of which of the infinite varieties of more complicated models might be correct. That's one statement of Occam's razor.
They are not dogmatically committed to there being no curvature, or no land masses, or even no outright edge of the world where the ocean falls into an infinite void. If they find evidence for any of those things, they'll add them to their model.
Looking at the earlier answers to this question, I'm struck by the fact that most of them suggested nontrivial topology as a way that a flat universe could be finite in area, but none of them mentioned that the universe may simply be inhomogeneous at large scales—despite the fact that, e.g., many varieties of inflationary cosmology imply an inhomogeneous universe, while I've never heard of a model that produces the initial conditions of a non-simply-connected FLRW universe. I also recently wrote an answer that was largely about a peer-reviewed paper, published in a respectable journal, that was wrong not because of a subtle mistake but because the authors (and apparently reviewers) seemed to completely misunderstand the role of FLRW geometries in cosmology. All of this suggests to me that many people do take a dogmatic view of the cosmological principle.
There's nothing in general relativity that requires the universe to be described by a FLRW geometry. The universe can be any shape. The FLRW geometry (ΛCDM variant) is just the simplest shape that fits what we see. It's the real-world version of the infinite planar ocean, nothing more.
A: This claim is simply wrong. The flat hyperplane is of course infinite, but  non trivial topologies can be flat and still finite. The simplest example is the 3-torus, but there are even the Klein bottle and the Hantzsche-Wendt manifold.
See for example page 27 of Janna Levin
 - Topology and the Cosmic Microwave
Background, which show you ten different closed flat 3-manifolds.
For further reading I suggest: William Thurston, Three-Dimensional Geometry and Topology,
Princeton University press (1997).
A: 
Why does a flat universe imply an infinite universe?
This article claims that because the universe appears to be flat, it must be infinite. I've heard this idea mentioned in a few other places, but they never explain the reasoning at all.

The section in question appears to be:

"The  Vardanyan model says that the curvature of the Universe is tightly constrained around 0. In other words, the most likely model is that the Universe is flat. A flat Universe would also be infinite and their calculations are consistent with this too. These show that the Universe is at least 250 times bigger than the Hubble volume. (The Hubble volume is similar to the size of the observable universe.)".
The Daily Galaxy via MIT Technology Review"

Technology review does make the aforementioned quote and says this as well:

"Other estimates depend on a number factors and in particular on the curvature of the Universe: whether it is closed, like a sphere, flat or open. In the latter two cases, the Universe must be infinite.".

Others and myself disagree.
A fairly simple explanation is provided at Wikipedia, all on one page.
Infinite or finite
One of the presently unanswered questions about the universe is whether it is infinite or finite in extent. For intuition, it can be understood that a finite universe has a finite volume that, for example, could be in theory filled up with a finite amount of material, while an infinite universe is unbounded and no numerical volume could possibly fill it. Mathematically, the question of whether the universe is infinite or finite is referred to as boundedness. An infinite universe (unbounded metric space) means that there are points arbitrarily far apart: for any distance d, there are points that are of a distance at least d apart. A finite universe is a bounded metric space, where there is some distance d such that all points are within distance d of each other. The smallest such d is called the diameter of the universe, in which case the universe has a well-defined "volume" or "scale."
With or without boundary
Assuming a finite universe, the universe can either have an edge or no edge. Many finite mathematical spaces, e.g., a disc, have an edge or boundary. Spaces that have an edge are difficult to treat, both conceptually and mathematically. Namely, it is very difficult to state what would happen at the edge of such a universe. For this reason, spaces that have an edge are typically excluded from consideration.
However, there exist many finite spaces, such as the 3-sphere and 3-torus, which have no edges. Mathematically, these spaces are referred to as being compact without boundary. The term compact basically means that it is finite in extent ("bounded") and complete. The term "without boundary" means that the space has no edges. Moreover, so that calculus can be applied, the universe is typically assumed to be a differentiable manifold. A mathematical object that possesses all these properties, compact without boundary and differentiable, is termed a closed manifold. The 3-sphere and 3-torus are both closed manifolds.
Curvature
The curvature of the universe places constraints on the topology. If the spatial geometry is spherical, i.e., possess positive curvature, the topology is compact. For a flat (zero curvature) or a hyperbolic (negative curvature) spatial geometry, the topology can be either compact or infinite. Many textbooks erroneously state that a flat universe implies an infinite universe; however, the correct statement is that a flat universe that is also simply connected implies an infinite universe. For example, Euclidean space is flat, simply connected, and infinite, but the torus is flat, multiply connected, finite, and compact.
In general, local to global theorems in Riemannian geometry relate the local geometry to the global geometry. If the local geometry has constant curvature, the global geometry is very constrained, as described in Thurston geometries.
The latest research shows that even the most powerful future experiments (like SKA, Planck..) will not be able to distinguish between flat, open and closed universe if the true value of cosmological curvature parameter is smaller than 10$^{−4}$. If the true value of the cosmological curvature parameter is larger than 10$^{−3}$ we will be able to distinguish between these three models even now.
Results of the Planck mission released in 2015 show the cosmological curvature parameter, ΩK, to be 0.000±0.005, consistent with a flat universe.

It is agreed that the universe is flat, or almost so.
Most people seem to disagree that flatness implies that the only size possible is infinite.
A flat piece of paper is not infinite, rolling it into a tube doesn't change it's size or weight.
They would have been in a better position to argue the inverse, that a sphere has a finite surface.
The failure to explain their reasoning is likely because it isn't true and logic doesn't support the statement.

Mihran Vardanyan (Oxford) has 3 papers on arXiv, 2 about the universe.
"How flat can you get? A model comparison perspective on the curvature of the Universe" (20 Apr 2009), by Mihran Vardanyan (Oxford), Roberto Trotta (Imperial College London), and Joe Silk (Oxford)

Page 14: "6 CONCLUSIONS
We have subjected the geometry of the Universe to a detailed scrutiny from a model comparison perspective, performing a three–way model selection with two physically motivated priors. We found that present–day data provide up to moderate evidence in favour of flatness (maximum odds of 66:1) for a specific choice of prior (the Astronomer’s prior) and
assuming that dark energy is a cosmological constant. A Curvature scale prior and a relaxation of the assumption on the nature of dark energy weaken this result considerably, giving only inconclusive odds of less than 3:2 in favour of flatness. Correspondingly, the probability that the Universe is infinite lies in the range from 67% to 98%, depending on
assumptions. If the Universe is not infinite, we have found a robust lower limit to the number of Hubble spheres, $N_U \gtrsim 5$.

"Applications of Bayesian model averaging to the curvature and size of the Universe" (28 Feb 2011), by Mihran Vardanyan (Oxford), Roberto Trotta (Imperial College London), and Joe Silk (Oxford)

Page 1: "The amount of curvature is usually characterized by the curvature parameter Ωκ: if Ωκ < 0 the geometry of spatial sections is spherical (i.e., the Universe is closed) and the Universe has a finite size. If instead Ωκ > 0 the geometry is hyperbolic (i.e., the Universe is open), while for Ωκ = 0 spatial sections are flat. In both the two latter cases, the spatial extent of the Universe is infinite.".

The definition of "spatial extent" is the maximum of the coordinates.
It seems as though he was misquoted.
