This is from P 134 of Rotman's Homological Algebra book.
If R is a PID, then every torsion-free R-module is flat.
Proof. If R is a PID, then every finitely generated R-module M is a direct sum of cyclic modules. If M is torsion-free, then it is a direct sum of copies of R.
I'm not sure why we need M to be torsion-free to have each cyclic module isomorphic to R. Any help would be appreciated! Thank you