Extend a function to group homomorphism This is maybe a trivial question.
Set up

Assume $S = \lbrace g_{1}, \dots, g_{n} \rbrace$ generate a group $G$ and $H$ is a finite group with elements $\lbrace h_{1}, \dots, h_{n} \rbrace$. In this case we have $\vert S \vert = \vert H \vert$.
Let $f: S \rightarrow H$, I know from a previous question on this homepage that $f$ can be extended to a group homomorphism $f': G \rightarrow H$. 
Question

In this case can we then conclude that $f'$ is an isomorphism? It is easy to see that $f'$ is surjective, but I "miss" the injective part. I think this makes sense, but I would like to get it verified. 
 A: As long as $G$ is the free group on the generating set $S$, then the universal property that characterizes $G$ is as follows:

For any group $H$ and any map of sets $\varphi: S \to H$, there exists a unique group homomorphism $\overline{\varphi}: G \to H$ such that $\varphi = \overline{\varphi} \circ \iota$, where $\iota: S \to G$ is the natural inclusion of the set as generators.

However, if $G$ has any relations among the generators in $S$, then you must first verify that the same relations are satisfied in the image under $\varphi$ before you can guarantee that it extends to a group homomorphism.
As long as $S \ne \varnothing$, the free group on $S$ is infinite, so the map to a finite group $H$ cannot be injective. 
A: Nope, this is not true. As an easy counterexample consider $S = H = \{1\}$, then $S$ generates the free abelian group $\mathbb{Z}$, and $f^\prime :\mathbb{Z} \rightarrow H$ is the trivial map sending everything to 1.
A: Take $S=\left\{ 1\right\} $ generating $\mathbb{Z}$ and for $H$
take the trivial group. Then there is a unique homomorphism $\mathbb{Z}\rightarrow H$
that can be interpreted as an extension of $f:S\rightarrow H$ but
that is not an isomorphism.
Secondly: the fact that $S$ generates group $G$ is not a garantee that a homomorphism $f'$ extending $f$ exists. You could have e.g. $S=G$ so that extensions of $f$ coincide with $f$ while $f$ is only asked to be a function, not necessarily a homomorphism. What you do need is that $G$ is a group that is free over set $S$. That is a stronger demand for $S$.
