Find all ring homomorphisms from $\Bbb Z/m\Bbb Z \rightarrow \Bbb Z/n \Bbb Z$ 
Find all ring homomorphisms from $\Bbb Z/m\Bbb Z \rightarrow \Bbb Z/n \Bbb Z$, where $m,n\in \Bbb N_{>0}$.

I know that there exists a group homorphism between $\Bbb Z/m\Bbb Z \rightarrow \Bbb Z/n \Bbb Z$ if and only if $n|m$ .
How should i continue ?
 A: Basically $\Bbb Z/m\Bbb Z$ is isomorphic to $\mathbb{Z}_{m}$ and $\Bbb Z/n\Bbb Z$ is isomorphic to $\mathbb{Z}_{n}$. Then you can find out ring homomorphism from $\mathbb{Z}_{m}$ to $\mathbb{Z}_{n}$. And number of ring homomorphism from $\mathbb{Z}_{m}$ to $\mathbb{Z}_{n}$ is $2^{\omega(n)-\omega(n/\gcd(m,n))}$, where $\omega(n)$ is number of distinct prime divisor of $n$. For example if we want to find out ring homomorphisms from $\Bbb Z/20\Bbb Z$ to $\Bbb Z/30\Bbb Z$, i.e. from $\mathbb{Z}_{20}$ to $\mathbb{Z}_{30}$, then we will proceed like this. Common divisors of $20$ and $30$ are $ 1,2,5$ and $10$, so elements of this order in $\mathbb{Z}_{30}$ are $0,3,6,9,12,15,18,21,24,27 $ which give us ten group homomorphism and only $0,6,15,21 $ are idempotent elements in $\mathbb{Z}_{30}$ out of the ten above mentioned elements which give us four ring homomorphism i.e $\phi(x)=ax$ where $a$ is $0,6,15,21$.
A: I assume that ring homomorphisms map $1$ to $1$.
Suppose $f\colon\mathbb{Z}/m\mathbb{Z}\to\mathbb{Z}/n\mathbb{Z}$ is a ring homomorphism. Then, if $\pi\colon\mathbb{Z}\to\mathbb{Z}/m\mathbb{Z}$ is the canonical projection, $f\circ\pi$ is the unique ring homomorphism $\mathbb{Z}\to\mathbb{Z}/n\mathbb{Z}$.
Since $\pi$ is surjective, this shows that at most one ring homomorphism $f$ exists.
A necessary condition for existence is that $n\mathbb{Z}=\ker(f\circ\pi)\supseteq m\mathbb{Z}$, hence that $n\mid m$.
It's easy to see that this condition is also sufficient.
