Is $R$ a PID if every submodule of a free $R$-module is free?
Solution 1:
Yes, it is.
If $a\in R$, $a\ne 0$, then $aR$ is free (as a submodule of the free $R$-module $R$), so $a$ is a non-zero divisor. In order to prove this let $ax$ be an element of an $R$-basis of $aR$. If $ba=0$ for some $b\in R$ then $b(ax)=0$ and therefore $b=0$. (For a characterization of free ideals see here.) This shows that $R$ is necessarily an integral domain.
Now let $I$ be a non-zero ideal of $R$. Since $I$ is free (as a submodule of the free $R$-module $R$) it must have a basis with a single element (as you already know), so $I$ is principal.
(As you may noticed, I've only used the property for the free $R$-module $R$.)
Solution 2:
I prove that $R$ is an integral domain. Let $a\in R\setminus\{0\}$. The exercise is equivalent to prove that the multiplication-by-$a$ morphism $m_a:R\rightarrow R$, $x\mapsto ax$ is injective.
By assumption $aR$ is free since is a submodule of the free $R$-module $R$. In particular there exists some isomorphism of $R$-modules $\phi:\oplus_{I}R \overset{\simeq}{\rightarrow} aR$, for some nonempty set $I$.
As Bahador explained this implies that $I$ consists of one element.
Thus there is an isomorphism $\phi: R \rightarrow aR\subset R$ of (cyclic) $R$-modules. Let $b=\phi(1)$ then $\phi=m_b$ and $bR = Im\, (m_b)= Im\,(\phi) = aR$.
In particular $b$ is not zero-divisor since $m_b$ is injective. Generators of a principal ideal differ by a unit if one of them is non-zero divisor so that there is some unit $u$ of $R$ such that $a=bu$.
In particular $m_a= m_u \circ m_b = m_u\circ \phi$ is injective.