It is to be shown that Hom$_\mathbb Z(\frac{\mathbb Z}{n\mathbb Z},\frac{\mathbb Z}{m\mathbb Z})\simeq \frac{\mathbb Z}{(n,m)\mathbb Z} $, i.e., isomorphic as modules over $\mathbb Z$.
I am very new to module theory. I tried to prove it the following way:
Let $f:\text{Hom}_\mathbb Z(\frac{\mathbb Z}{n\mathbb Z},\frac{\mathbb Z}{m\mathbb Z})\to \frac{\mathbb Z}{(n,m)\mathbb Z}$ be defined by $f(\phi)=\phi(\bar 1)$ for every $\phi$ in the domain.
$\phi$ is a group homomorphism as well and therefore $|\phi(\bar 1)|| (n,m)$, which implies that $\phi(\bar 1)\in \frac{\mathbb Z}{(n,m)\mathbb Z}.$ This $f$ is clearly well defined.
For any $\phi, \psi$ in domain of $f$ and any $z\in \mathbb Z$,
$f(\psi+\phi)=(\psi+\phi)(\bar 1)=\psi(\bar 1)+\phi(\bar 1)=f(\psi)+f(\phi)$ and $f(z\phi)=z\phi(\bar 1)=zf(\phi)$.
It follows that $f$ is a homomorphism. $f$ is surjective by its construction. Since mapping $\bar 1\in \mathbb Z/n\mathbb Z$ determines $\phi$, it follows that $f$ is 1-1. Therefore, $f$ is a module isomorphism. This proves the result.
Is my proof correct? Thanks.