The condition that a ring is a principal ideal domain If $R$ is a nonzero commutative ring with identity and every submodule of every free $R$-module is free, then $R$ is a principal ideal domain.
What I don't know is how to show that every ideal is free. Once an ideal is free, for nonzero $u,v\in I$, $uv-vu=0$ shows that the ideal has only one basis. that is, the ideal is principal. Any help?

Consider $R$ as $R$-module, then this is free, with basis $\lbrace 1 \rbrace $. 
Suppose $I \subseteq R $ is an ideal, $I \neq 0 $; then $I$ is a submodule, whence it is free.  If $u, v \in I $ they are linearly dependent over $R$, because $vu -uv = 0 $. 
This implies that if $B= \lbrace u_1, u_2, \ldots \rbrace $ is a basis for $I$ as $R$-module, then $|B| = 1 $, so $I = < w > $ and I is a  principal ideal.  
For the domain part, if $a \in R $ , $a \neq 0 $, suppose $ba = 0 $ with $b \neq 0 $. Then consider $I = <a> $. By the previous part $I$ has a basis $\lbrace w \rbrace $. We have $w = k a $ for $ k \in R $. Then $$ bw = bka = k (ba) = 0$$ But $w $ is linearly independent and $b \neq 0 $. This is a contradiction and so $ba \neq 0 $.
