I know that the map $\phi \colon \mathbb{Z}_6 \to \mathbb{Z}_2$, given by $$ \phi(x) = \ \mbox{ the remainder of $x$ when divided by $2$, as in the division algorithm}, $$ is a homomorphism of $\mathbb{Z}_6$ onto $\mathbb{Z}_2$.
However, the map $\phi \colon \mathbb{Z}_9 \to \mathbb{Z}_2$, given by the same formula as above, is not a homomorphism.
Now my question is, given natural numbers $m$ and $n$ such that $m > 1$ and $n > 1$, what is (are) the necessary and sufficient condition(s), or set of conditions, if any, such that the map $\phi \colon \mathbb{Z}_m \to \mathbb{Z}_n$, given by the above formula, is a homomorphism of $\mathbb{Z}_m$ into / onto $\mathbb{Z}_n$?
The map $\mathbb{Z}_9 \to \mathbb{Z}_2$ doesn't even exist! There is a well-defined map $r_n : \mathbb{Z} \to \mathbb{Z}_n$ which sends an integer to its remainder modulo $n$. In fact, $r_n$ is a homomorphism (you should prove this). If you want this to induce a function $\mathbb{Z}_m \to \mathbb{Z}_n$, it better be constant on the equivalence classes $[a] = \{a+km : k\in \mathbb{Z}\}$! So: when is it the case that $r_n(x) = r_n(x+m)$ for all $x \in \mathbb{Z}$?