About Prufer domain and its valuation ring at maximal ideal I try to prove the two proposition imply each other when $A$ is an integral domain: 
(1) $A_\mathfrak m$ is valuation ring for every maximal ideal $\mathfrak m$
(2) $A$-module is flat if and only if it is torsion-free
I have shown "(1) implies (2)." and it is left to show "(2) implies (1).".
I thought it is hard to prove directly so after some speculation, I figured out (2) implies "Any finitely-generated ideal is invertible.". And now, I cannot imagine how to show (1) is true from what I got.
So can anyone give me a hint? 
 A: Hint:
So any finitely generated ideal is projective, and  the same is true for any ring of fractions of $A$. If you consider  localisations of $A$ at a prime ideal, finitely generated ideals are free, hence principal, and 
the only thing you have to prove is that a local integral domain such that finitely generated ideals are principal, is a valuation domain.
Show that if $a, b$ are elements in $A$ then either $Aa\subset Ab\,$ or $Ab\subset Aa$. For this, let $c$ be a generator of the ideal $\langle\,a, b\,\,\rangle$. Deduce from the fact that $A$ is local that $Aa=Ac$ or $Ab=Ac\;$ (in other words, if an  ideal is generated by $a$ and $b$, it is generated by $a$ or $b$).
A: I will follow the techniques in http://www.math.uchicago.edu/~may/MISC/Dedekind.pdf
First, by localizing and using the fact that every finitely generated (fractional) ideal in $S^{-1}(A)$ is of the form $S^{-1} (I)$ for a finitely generated (fractional) ideal $I$ in A, we can reduce the problem to showing the following: 
If $A$ is an integral domain (not a field), which is a local ring and every finitely generated fractional ideal is invertible, then $A$ is a valuation ring.
Let $x = a/b$. Consider the (fractional) ideal generated by $a$ and $b$, i.e., $(a,b)$. Proposition 1.6 tells you that $(a,b)$ is projective as $A$ module. Now since $A$ is local, this means $(a,b)$ is free. But of course, $b.a - a.b = 0$, so $(a,b)$ has rank $1$ as an $A$ module. Let $c := (a,b)$. Let $a = ct_1$ and $b = ct_2$. So $(t_1,t_2) = A$, i.e, either $t_1$ or $t_2$ is a unit. Since $x = a/b= t_1/t_2$, you can conclude that either $x$ or $x^{-1}$ is in $A$.
Comments: As you must have noted you can replace maximal ideal by prime in your original question. Also, I spent quite some time trying to do it by computation and failed. Can anyone point out a more explicit proof without localizing? (That is demonstrating $p$ and $q$ such that $aq = bp$ where one can actually say that either $p$ or $q$ is not in $\mathfrak m$.) 
