Consider $R$ a commutative ring with unity. Then all the $R$-modules are free iff $R$ is a field. Let $M$ be an $R$-module.
$\Leftarrow$ is clear as $M$ is an $R$-vector space that has a basis. For the converse, consider $I$ a maximal ideal of $R$. I want to prove that $I$ is 0. Firstly I consider $\dfrac{R}{I}$ that is a $R$ module, so it is free. $\dfrac{R}{I}$ does not have any proper ideal, apart from $0$, as its ideal would contain $I$, which is a maximal ideal. Then $R/I\cong R^{(\Lambda)}$. Now, $\# \Lambda$ cannot be 0 (if it was 0 then $\dfrac{R}{I}$ would be 0 modules, that is false by hypothesis). $\# \Lambda$ can be 1, but cannot be greater than 1, and I cannot understand why. During lessons, I wrote, "Because of if $\# \Lambda >1$ then there are non-trivial submodules". I cannot understand this last implication i.e why if $\#\Lambda>1$ then $\dfrac{R}{I}$ has non-trivial ideal.
This is because $R/I$ is a so called simple module when $I$ is a maximal ideal; it has no proper submodules. But if $\#\Lambda>0$, then $R^{(\Lambda)}$ must have a proper submodule, namely in the form of direct summand copies of $R$. Thus $R/I$ has proper submodules, which cannot be.
To illustrate: If $\#\Lambda=2$. Then $R^{(\Lambda)} \cong R^2=R \oplus R$. Let $N=\{(a,0) \mid a \in R\} \subseteq R \oplus R$. Then $N$ is a proper submodule of $R^2$ that is a direct summand of $R \oplus R$, and is isomorphic to $R$. The point is, anytime you have a direct sum, the components of the direct sum sit inside as submodules.