Let M be a unital R-module with $S\subseteq M$ a generating set, that is =M, then there exists a free R module F such that with basis B such that:
- |S|=|B| and
- $\exists \phi \in Hom_R(F,M)$ such that $\phi$ is onto
My idea so far has been to simply take B to be equal to S and define $\phi$ by the R module homomorphism created by extending the identity map on S to F, so by $\phi :F \rightarrow M$ is an homomorphism and it’s onto since S generates M Then if you let N be and R module and $\psi :B \rightarrow N$ be any set map. Then we want to show F is free, so we want to show there exists a singular R module homomorphism $\phi$ from F to N that extends $\psi$. Let $\phi(s)=\psi(s)$ for any $s \in S$. Then $\phi(rs)=r\phi (s)=r \psi (s)$ so $\phi$ extends $\psi$ for and $s \in S, r\in R$. Since any such homomorphism must agree with $\psi$ on S, which determines $\phi$ uniquely, it’s the unique R module homomorphism that extends $\psi$, So |B|=|S| and F is a free module with onto homomorphism from F to M
I think you can use a different characterization of free $R$-modules. While the universal property is certainly nice, an equivalent (assuming $R$ has an identity and all modules are unitary) definition for an $R$-module $F$ to be free is that $F$ must have a basis.
With that in mind, let $$F= \sum\limits_{s\in S} R,$$ where the copies of $R$ are indexed by the set $S$. For each $s\in S$, let $\delta_s$ be the element $\{r_i\}\in F$ where $r_i=1$ if $i=s$ and $r_i =0$ otherwise. The set $\{\delta_s\}_{s\in S}$ is a basis $B$ for $F$, and by our construction, $|B|=|S|$.
For your map $\phi$, then, try extending a bijection from $B$ onto $S$ linearly.