A ring homomorphism is also a group homomorphism between $\displaystyle (\mathbb{Z}_n,+)$ and $\displaystyle (\mathbb{Z}_m,+)$. Since $\displaystyle [1]_n$ generates the group it means this homomorphism is completely determined by its value on this element. Can you finish it now?