Free Group Generated By Image Let $S$ be any set and let $f:S \rightarrow F$ denote the free group on $S$. By definition, this means that for any group $X$ and any function $g:S \rightarrow X$ there exists a unique homomorphism $h:F \rightarrow X$ such that $h \circ f = g$. How can I show that $f(S)$ generates $F$? By "generate $F$" I mean that the intersection of all subgroups of $F$ containing $f(S)$ equals $F$.
 A: This is a standard property that can be derived from the universal property of $F$.
Let $H$ be the subgroup generated by $f(S)$ in $F$. Then consider the embedding $\iota\colon S\hookrightarrow H$ induced by $f$. By the universal property, there exists a unique homomoprhism $\varphi\colon F\to H$ such that $\varphi\circ f =\iota$. If we compose $\iota$ with the inclusion $j\colon H\to F$, then we obtain a map $j\circ\iota\colon S\to F$, and so there is a unique homomorphism $\psi\colon F\to F$ such that $\psi\circ f = j\circ\iota$. Of course, $\psi=\mathrm{id}_F$ works. On the other hand, so does $j\circ\varphi$, since
$$(j\circ\varphi)\circ f = j\circ(\varphi\circ f) = j\circ \iota.$$ 
Therefore, by the uniqueness clause of the universal property, $j\circ\varphi=\mathrm{id}_F$. Since $j\circ\varphi$ is a bijection, it follows that $j$ is onto. Since $j$ is the inclusion $H\to F$ and is onto, then $H=F$, as desired.
Note. The above argument works in many settings! It shows that the free semigroup on $S$ is generated by the (image of) $S$, same for free rings, relatively free groups, free lattices, etc. In fact, it works in any variety of algebras (in the sense of universal algebra). 
