Number of ring homomorphisms $\mathbb{Z}/a\mathbb{Z} \times \mathbb{Z}/a \mathbb{Z} \to \mathbb{Z}/b\mathbb{Z}$, $a,b \in \mathbb{P}$ Number of ring homomorphisms $\mathbb{Z}/a\mathbb{Z} \times \mathbb{Z}/a \mathbb{Z} \to \mathbb{Z}/b\mathbb{Z}$, $a,b \in \mathbb{P}$.
I thought about using the fact, that the kernel of a ring homomorphism needs to be an ideal in $\mathbb{Z}/a\mathbb{Z} \times \mathbb{Z}/a \mathbb{Z}$ and a subgroup of the additive group of $\mathbb{Z}/a\mathbb{Z} \times \mathbb{Z}/a \mathbb{Z}$.
Let $f$ be such an ring homomorphism hence yields that $|f^{-1}(0)| \in {1,a,a^2}$.
Is it possible to proceed from here or what's a better way to go?
 A: Since this is a ring homomorphism, the map must take $1$ to $1$.
$\mathbb Z/a\mathbb Z$ is a subring of $\mathbb{Z}/a \mathbb{Z} \times \mathbb{Z}/a \mathbb{Z}$ via the diagonal embedding. The image of this subring under the homomorphism realizes $\mathbb Z/a\mathbb Z$ as a subring of $\mathbb Z/p\mathbb Z$. Since $p$ is a prime, this is impossible unless $a=p$.
A: It's often easier to do algebra with rings when you express them as quotients of polynomial rings or similar.
We know that $\mathbb{Z} / p \times \mathbb{Z}/p$ contains $\mathbb{Z} / p$ along its diagonal. But how to capture the rest of it?
Well, we can do this by adjoining $(0,1)$ to the diagonal copy of $\mathbb{Z} / p$. Its minimal polynomial is $x^2 - x$, and so I claim:
$$ \mathbb{Z} / p \times \mathbb{Z} / p \cong (\mathbb{Z} / p) [x] / (x^2 - x) $$
The inverse sends $x \mapsto (0,1)$. The forward direction sends $(1,0) \to 1 - x$ and $(0,1) \to x$. These are both ring homomorphisms, so we see the sketch above gives a correct result.
Thus, your goal is to find homomorphisms
$$ (\mathbb{Z} / a) [x] / (x^2 - x) \to \mathbb{Z} / b$$
which you can do with the powerful tools for describing homomorphisms from such rings.
