I'm trying to show that if $F$ is a free $R-$module and $g:M\rightarrow F$ is a surjective $R-$homomorphism then $M \simeq Ker(f)\oplus F$.
What I have done so far:
Let $X=\{x_i\}_{i\in I}$ be a base for $F$, define the $R-$homomorphism $h:F\rightarrow M$, taking for each $x_i \in X$ an element $m_i \in M$ such that $g(m_i)=x_i$ and define $h(x_i)=m_i$ then extend it by linearity
Then, for each $n \in F$, we have $g\circ h(n)=g(h(\sum_{i\in I}\lambda_ix_i))=\sum_{i\in I}\lambda_ig(h(x_i))=\sum_{i \in I}x_i=n$
and $$h(n)=h(n') \Rightarrow h(n-n')=0 \Rightarrow g(h(n-n'))=g(0)=0 \Rightarrow n-n'=0 \Rightarrow n=n'$$
Hence, $h $ is injective and then $F\simeq h(F)$
Now, let $m\in h(F) \cap Ker(g)$, then $g(m)=0$ and $m=h(n)$ for some $n\in F$, it follows that $$g(h(n))=g(m)=0\Rightarrow n=0\Rightarrow h(n)=m=0$$
What have I done so far is acceptable?
What I'm trying to do now is show that every element of $M$ can be written as a sum $y+k$ with $y \in Im(h)$ and $k \in Ker(g)$ and then i think the conclusion follows easily.
P.S: Sorry for grammar mistakes, I learned English with video games.