Describe explicitly $\operatorname{Hom}_{\mathbb{Z}}(\mathbb{Z}_n, \mathbb{Z}_m) := \{\varphi:\mathbb{Z}_n \rightarrow \mathbb{Z}_m \mid \mathbb{Z}\text{-linear homomorphism}\}$
There is an answer to this question that says $\operatorname{Hom}_{\mathbb{Z}}(\mathbb{Z}_n, \mathbb{Z}_m) \cong \mathbb{Z}_{(n,m)}$ where $(n,m)=\gcd(n,m)$. But I am having some trouble seeing this.
For the sake of an argument, suppose the above answer is true, that $\operatorname{Hom}_{\mathbb{Z}}(\mathbb{Z}_n, \mathbb{Z}_m) \cong \mathbb{Z}_{(n,m)}$. Suppose $n=4$ and $m=8$. Then $\operatorname{Hom}_{\mathbb{Z}}(\mathbb{Z}_4, \mathbb{Z}_8) \cong \mathbb{Z}_4$.
Now consider each of the following maps in $\operatorname{Hom}_{\mathbb{Z}}(\mathbb{Z}_4, \mathbb{Z}_8)$:
$\varphi_1(1)=1$
$\varphi_2(1)=2$
$\varphi_3(1)=3$
$\varphi_4(1)=4$
$\varphi_5(1)=5$
$\varphi_6(1)=6$
$\varphi_7(1)=7$
Are each of these maps not unique? If there are two that are identical, could you please explain which two and why? Thank you!
My alternate answer is that $\operatorname{Hom}_{\mathbb{Z}}(\mathbb{Z}_n, \mathbb{Z}_m) \cong \mathbb{Z}_m$, since I think each $\varphi \in \operatorname{Hom}_{\mathbb{Z}}(\mathbb{Z}_n, \mathbb{Z}_m)$ is uniquely determined by where it maps $\varphi(1) \in \mathbb{Z}_m$.
Hint:
For all $k \in \Bbb Z$, let us put: $\overline{k}=k+n\mathbb Z$ and $\mathop k^\bullet=k +m\mathbb Z$
Since $\varphi$ is a morphism and $n.\overline{1} =\overline{0}$ we have necessarely : $n.\varphi(\overline 1)= \mathop0^{\bullet}$
That means that the order $\varphi(\overline 1)$ must divide $n$.
We know yet that the ordre of $\varphi(\overline 1)$ divides $m$, that means that the ordre of $\varphi(\overline 1)$ divides $\gcd(n,m)$
In your example above here is the elements order table in $\Bbb Z_8$: $$\begin{array}{|c|c|c|c|c|c|c|c|c|}\hline \text{element }&0&1&2&3&4&5&6&7\\ \hline \text{order} &1&8&4&8&2&8&4&8 \\ \hline\end{array}$$
The possible images of $\overline 1$ are : $\mathop 0^{\bullet},\mathop 2^{\bullet},\mathop 4^{\bullet},\mathop 6^{\bullet}, $ elements wich order divides $4$
Details:
Let $\varphi$ a morphisme from ${\mathbb Z}_n$ to ${\mathbb Z}_m$ and $G$ the image of $\varphi$. We have $$G=\langle \varphi(\overline 1) \rangle$$ and it's order is $\delta$ a divisor of $(m,n)$. It's known that there is a unique subgroup $G$ of $\mathbb Z_m$ having $\delta$ as order so this group is $G$. It's known too that $G$ has $\phi(\delta)$ generators (where $\phi$ is the Euler indicator) . All theses generators have $\delta$ as order and are differents so they determine $\phi(\delta)$ morphisms. We conclude that the number of all morphisms is : $$\sum_{\delta|(m,n)} \phi(\delta)=(m,n)$$