Characterization of Injective rings homomorphism from $\mathbb{Z}_m$ to $\mathbb{Z}_n$ Show that there is an injective ring homomorphism $f:\mathbb{Z}_m \rightarrow \mathbb{Z}_n$ if and only if $m\mid n$ and $\frac{n}{m}$ is relatively prime with $m$.
In one direction, was not difficult to check that $m$ divides $n$, because $n\cdot f(\overline{1})= f(n\cdot \overline{1})=f(\overline{n})$, but $n\cdot f(\overline{1})$ is a multiple of $n$ in $\mathbb{Z}_n$, therefore $f(\overline{n})=0$, and because $f$ is homomorphism, $f(\overline{0})=0$, then $f(\overline{n})=f(\overline{0})$, and this implies (because $f$ is an injection) that $\overline{n}=\overline{0}$ i.e. $n$ is multiple of $m$. However, I don't know how to conclude that $\frac{n}{m}$ is relatively prime with $m$.
On the other direction, to proof that there is an injective ring homomorphism $f:\mathbb{Z}_m \rightarrow \mathbb{Z}_n$, I don't where to use the facts $m\mid n$ and $\frac{n}{m}$ is relatively prime with $m$ to get the conclusion.
 A: Suppose there is an injective ring homomorphism $f:\mathbb{Z}_m\rightarrow\mathbb{Z}_n$, let $\overline{k}=f(\overline{1})$. Then it is easy to see that $\forall x\in\mathbb{Z}:(f(\overline{x})=\overline{0}\Leftrightarrow n\mid xk)$ and $\forall x\in\mathbb{Z}:(\overline{x}=\overline{0}\Leftrightarrow m\mid x)$, so $\forall x\in\mathbb{Z}:(n\mid xk\Leftrightarrow m\mid x)$. So, because $n\mid nk$, then $m\mid n$, so let $n=md$. Also, because $m\mid m$, then $n\mid mk$, so $d\mid k$. Moreover, it is easy to see that $\overline{k^2}=\overline{k}$ (apply $f$ to $\overline{1}\cdot\overline{1}=\overline{1}$), so $n\mid (k-1)k$, so $m\mid k-1$. Therefore, because $d\mid k$ and $m\mid k-1$, we conclude that $d$ is relatively prime with $m$.
On the other hand, if $n=md$ and $d$ is relatively prime with $m$, then there are $m',d'\in\mathbb{Z}$ such that $mm'+dd'=1$, so let $k=dd'$, then $d\mid k$ and $m\mid k-1$, so $n\mid k(k-1)$ and $\forall x\in\mathbb{Z}:(n\mid xk\Leftrightarrow m\mid x)$. Then it easy to see that the unique additive function $f:\mathbb{Z}_m\rightarrow\mathbb{Z}_n$ such that $f(\overline{1})=\overline{k}$ is in fact an injective ring homomorphism.
