Ring homomorphism The number of non-trivial ring homomorphisms from $\mathbb{Z}_{12}$ to $\mathbb{Z}_{28}$ is
(Options:                                                                                                            a.1  b.3  c.4  d.7)
 A: To be a mere group homomorphism, then the order of the image of 1 will have to divide both 12 and 28. So that leaves four options for 1 to map to.
If it has to be a ring homomorphism, then 1 must map to an idempotent element of $\mathbb{Z}_{28}$. Only two of the four previous possibilities are idempotent.
A: I'm, going to proove more general fact: the order of the group $Hom(\mathbb Z_m, \mathbb Z_n)$ (i.e the group of homomorphisms from $\mathbb Z_m$ to $\mathbb Z_n$) is $gcd(m,n)$.
It's obvious that the order of the image of any homomorphism from $\mathbb Z_m$ to $\mathbb Z_n$ must devide both $m$ and $n$. Let us notice that for any $d$ that divides $n$ there exists a unique subgroup $H$ in $\mathbb Z_n$ which order is $d$ (if $n=dq$ then $H=\{0, d, 2d, ... , d(q-1)\}$). 
There is also a simple fact that the number of generators of finite cyclic group $<a>_n$ of order $n$ is $\phi(n)$, where $\phi$ is Euler's totient function (by definition $\phi(n)$ is an arithmetic function that counts the number of positive integers less than or equal to $n$ that are relatively prime to $n$). Now I'm going to prove it.
At first let's show that if $a^q$ is a generator then $gcd(q,n)=1$. Assume that $q$ and $n$ aren’t relatively prime. Therefore $q = kx$, and $n = ky$ for some integers $x$ and $y$. This means that $a^{qy} = a^{kxy} = a^{xn}=1$. So the order of $a^q$ is $y$. But $y<n$. It means that $a$ couldn't be a generator. Therefore if $a^q$ is a generator then $q$ and $n$ are relatively prime.
Now we want to show that if $gcd(q,n)=1$, then $a^q$ is a generator. More pricisely, we need to proove that if $(a^q)^s = 1$, then $s = xn$ for some integer $x$. It's obvious that $qs=xn$ for some integer $n$ (because $(a^q)^s = 1$ and our group has order $n$). But $gcd(q,n)=1$, so it's easy to see that $n$ devides $s$.
It remains to observe that given a homomorphism from $\mathbb Z_m$ to subgroup $H$ in $\mathbb Z_n$ means to set the map of $1$ to one of generators of $\mathbb Z_n$. Therefore the number of homomorpisms is $\sum_{k|gcd(m,n)} \phi(k)$ which equals $gcd(m,n).$
So the answer to your question: $gcd(12,28)=4$
