So I know that the following argument I will give is not correct, but I can not understand why. Any help ? I am working with commutative rings.
Let $R$ be a ring such that any submodule of a free $R$-module is free. We prove that $R$ is a field by proving that the only ideals of $R$ are the trivial ones.
Let $I$ be a non-zero ideal of $R$. Since $R$ is a free module over itself, by assumption, the ideal is then a free $R$-submodule. However, for any elements $a,b\in I$ we have that $ab +(-b)a=0$. Therefore the cardinality of any basis of $I$ should be equal to 1. But a free $R$-module with one element in the basis is isomorphic to $R$. Thus $I=R$, which concludes the proof.
The following part is wrong:
A ring can be isomorphic to an ideal without being equal.
To understand why your proof is wrong, consider the case $R=\mathbb Z$ and $I=2 \mathbb Z$. Everything woorks well untill you show that $R$ and $I$ are isomorphic (they are as $R$-modules). But this does not imply that they are equal.
Also $R=\mathbb Z$ satisfies the given condition, but it is not a field. The result you are trying to prove is not correct. Try proving instead that every ideal in $R$ is principal.
Note You can also show that $R$ is an integral domain. Indeed, if $R$ has a $0$ divisor $a$, then $\langle a \rangle$ is a submodule of the free module $R$ which is not free.