Example of a finitely generated flat module which is not free I couldn't come up with an example of a finitely generated flat module which is not free. I know that over local rings, freeness and flatness are equivalent. So the ring cannot be a local ring. 
 A: Let $R$ be a semisimple ring which isn't a division ring, and take an idempotent $e\notin \{0,1\}$. Then we have that $R=eR\oplus(1-e)R$ is a nontrivial decomposition of $R$, and both pieces are cyclic and projective (since they are summands of $R$) hence flat.
Actually neither piece is a free module, but we'll argue here that at least one of them isn't free to simplify things. If they were both free, that would imply that $R\cong R^n$ for some $n>1$ as modules. (Each factor contributes at least one $R$, you see.) But since $R$ has the IBN property, this is impossible. 
Thus at least one of the pieces is flat but not free.

If you really want to be concrete, you can use a finite semisimple ring to make things obvious: let's try $R=\Bbb F_2\times\Bbb F_2$. $\Bbb F_2$ is denoting the field of two elements.
The module $I=\Bbb F_2\times \{0\}$ is a direct summand of $R$, but it can't be free: a free module would have to have at least four elements, and this module only has two elements!
A: Here is an example that one can come up with from algebraic number theory. Consider $K = \Bbb{Q}(\sqrt{-6})$ and the ideal $I = (2,\sqrt{-6}) \subseteq \mathcal{O}_K$. This ideal is clearly finitely generated as an $\mathcal{O}_K$ module and furthermore not only is it flat but it is a projective module: we have
$$I \oplus ( 3,\sqrt{-6}) \cong (\sqrt{-6}) \oplus \mathcal{O}_K \cong \mathcal{O}_K \oplus \mathcal{O}_K.$$
If you're interested in knowing how we have such isomorphisms you can look at my answer here. But now $I$ cannot possibly be free because the generators are linearly dependent over $\mathcal{O}_K$:
$$3 \cdot (2) + \sqrt{-6} \cdot (\sqrt{-6}) = 0.$$
A: Rings over which every module is flat are called absolutely flat, or Von Neumann regular. If $I$ is any nontrivial ideal of an absolutely flat ring, then $R/I$ is finitely generated flat over $R$, but not free (since $R/I \neq 0$ and $\mathrm{Ann}(R/I)=I \neq 0$). Products of fields are absolutely flat.
