Free group and universal property I'm trying to understand universal properties. An example is the definition of a free group (as I understand it so far):
Revised definition:
A free group $F_S$ over a set $S$ is a pair $(g,F_S)$ that satisfies the (universal) property that if $G$ is a group and $f: S \to G$ is a map then there exists a unique homomorphism $\varphi : F_S \to G$ such that $\varphi \circ g = f$.
(What I had written before: 
If $S$ is a set and $G$ is a group and $f: S \to G$ is an arbitrary map then the free group over $S$ is the pair $(g,F_S)$ that satisfies (the universal property) that there exists a unique homomorphism $\varphi : F_S \to G$ such that $ \varphi \circ g = f$.)
Is the map $g: S \to F_S$ required to be the inclusion or can it be an arbitrary map?

The universal property implies that the map must be a one-to-one set-theoretic map.
To see this, let $a,b\in S$ be such that $g(a)=g(b)$. Let $G$ be a nontrivial group (e.g., $G=C_2$, the cyclic group of order $2$) and let $g\in G$ be a nontrivial element. Let $f\colon S\to G$ be defined by
$$f(s) = \left\{\begin{array}{ll}
1 & \text{if }s\neq a,\\
g &\text{if }s=a.
\end{array}\right.$$
By the universal property, there exists a group homomorphism $\varphi\colon F\to G$ such that $f=\varphi\circ g$. In particular, $f(b) = \varphi(g(b)) = \varphi(g(a)) = f(a) = g$, hence $b=a$ (since the only element of $S$ that is mapped to $g$ by $f$ is $a$). 
Therefore, $g$ is one-to-one. 
Once you know it is one-to-one, you may replace $S$ with $g(S)$ and consider it to be the inclusion, since the universal property also gives:
Theorem. Let $S$ and $T$ be sets, and let $f\colon S\to T$ be a bijection. If $(g,F_S)$ and $(h,F_T)$ are free groups on $S$ and on $T$, then $f$ induces a unique isomorphism $\Phi\colon F_S\to F_T$ such that $\Phi\circ g = h$ and $\Phi(g(s)) = h(f(s))$ for all $s\in S$.
Proof. Use the universal property of $(g,F_S)$ with $h\circ f$ to obtain $\Phi$. Then use the universal property of $(h,F_T)$ with $g\circ f^{-1}$ to obtain a map $\Psi$. Finally, use the uniqueness clause of the definition to prove that $\Phi\circ\Psi$ and $\Psi\circ\Phi$ are the corresponding identity morphisms. $\Box$
So we can replace a free group on $S$ $(g,F_S)$ with the free group $(\iota,F_{g(S)})$ which is free on $g(S)$, and which is canonically isomorphic to $(g,F_S)$. 
