Let $G$ be a group, $S = \{ x \}, \,Z_n = \langle x \rangle$, and $\overline{\varphi} : S \rightarrow G$ a set mapping. Then $\overline{\varphi}$ extends to a homomorphism $\varphi : Z_n \rightarrow G$ if and only if $\overline{\varphi}(x)^n = 1$.
How to prove $\Leftarrow$?
My try: We need to show $\varphi(x^ax^b)=\varphi(x^a)\varphi(x^b)$, but all I can see is $\overline{\varphi}(x)^{a+b}=\overline{\varphi}(x)^a\overline{\varphi}(x)^b$.
There's a mapping from $\mathbb{Z}$ to $G$ by sending $1$ to $\overline\varphi(x)$. The image of this $\mathbb{Z}$ is a cyclic group by the first isomorphism theorem. Now we can quotient by the kernel to get an injection. Assume $\overline\varphi(x)^n=1$. Then the kernel contains $n\mathbb{Z}$. So by the universal property of the quotient, there's a unique map from $\mathbb{Z}/n\mathbb{Z}$ to $G$ which commutes with the map induced by $\overline\varphi(x)$. Specifically, it extends to a homomorphism $\varphi$ as desired.