Can someone give me a simple example of a free group with a basis, given the definition below? I don't think I'm understanding the definition clearly.
For example if $F= (\Bbb Z, +)$, $X = \{0\}$, $\phi\colon\{0\} \rightarrow G$ is any function, then there should exist a unique homomorphism $\tilde \phi\colon \Bbb Z \rightarrow G$ such that $\tilde \phi(0) = \phi(0)$.
But if $\phi\colon\{0\} \mapsto \text{non identity element of $G$}$, then there's no way any homomorphism exists because identities of one group are mapped to the other group.

The simplest example is $(\mathbb{Z},+)$ with the basis $X=\{1\}$. Let $\varphi$ be any function from $X$ into a group $G$ and let $g=\varphi(1)$. Now, define $\tilde{\varphi}(m)=g^m$, for each integer $m$. Then $\tilde\varphi$ is a group homomorphism. Furthermore, it is the only group homomorphism from $(\mathbb{Z},+)$ into $G$ such that $\tilde\varphi(1)=\varphi(1)$.