In a discussion on MO, I found someone claiming the following:
Proposition: For a commutative unital ring $R$, the following are equivalent:
(i) every submodule of a free $R$-module is free;
(ii) every ideal $I\!\trianglelefteq\!R$ is free as a $R$-module;
(iii) $R$ is a PID.
Proof: (i)$\Rightarrow$(ii) is obvious.
(iii)$\Rightarrow$(i) is theorem 8.6.1 in Grillet's Abstract Algebra.
But how can I prove (ii)$\Rightarrow$(iii)? I have to prove that $xy=0$ implies $x=0$ or $y=0$; and also that every $I\!\trianglelefteq\!R$ is of the form $I=(a)$. We know every $I\!\trianglelefteq\!R$ has a basis $B=\{b_i;i\!\in\!I\}$ and therefore $I\cong R^{(B)}$.