Proving that $\operatorname{Hom}(\mathbb{Z}/m\mathbb{Z},\mathbb{Z}/n\mathbb{Z}) \cong \mathbb{Z}/\gcd(m,n)\mathbb{Z}$ using short exact sequences.
A short exact sequence $0 \to A \to B \to C \to 0$ of modules can be lifted to a short exact sequence of abelian groups$0 \to \operatorname{Hom}(C, P) \to \operatorname{Hom}(B, P) \to \operatorname{Hom}(A,P)$. But how does this apply to our situation here? I do not see where $\gcd(m,n)$ fits into this frame.
Here is a try. Consider the following exact sequence $0\to\mathbb{Z}\xrightarrow{i_n}\mathbb{Z}\xrightarrow{p}\mathbb{Z}/n\mathbb{Z}\to 0$ where $ i_n$ is the multiplication by $n$ and $p$ is the quotient map. Now, by applying $Hom(-,\mathbb{Z}/m\mathbb{Z})$ you get that this sequence \begin{equation*} 0\to \operatorname{Hom}(\mathbb{Z}/n\mathbb{Z},\mathbb{Z}/m\mathbb{Z}) \xrightarrow{p^*} \operatorname{Hom}(\mathbb{Z},\mathbb{Z}/m\mathbb{Z}) \xrightarrow{i_n} \operatorname{Hom}(\mathbb{Z},\mathbb{Z}/m\mathbb{Z}) \end{equation*} is exact. Observe that $\operatorname{Hom}(\mathbb{Z},\mathbb{Z}/m\mathbb{Z})\cong\mathbb{Z}/m\mathbb{Z}$ and hence, by this we have that $\operatorname{Hom}(\mathbb{Z}/n\mathbb{Z},\mathbb{Z}/m\mathbb{Z})\cong \mathbb{Z}/m\mathbb{Z}[n]$ where $\mathbb{Z}/m\mathbb{Z}[n]=\left \{ a \in \mathbb{Z}/m\mathbb{Z} : na\equiv 0 \mod m \right \}$. Now if you try to solve this equation you will see that you have gcd$(n,m)=d$ choices for $a$. Can you conclude from here?