Ring homomorphisms from $\mathbb Z/12\mathbb Z$ to $\mathbb Z/20\mathbb Z$? I've seen the very problem asked previously here but I'm here for more of an explanation for what my textbook is doing.

I am asked to find the number of ring homomorphisms from $\mathbb Z/12\mathbb Z$ to $\mathbb Z/20\mathbb Z$.

I've attempted using the fact that homomorphisms "maps the identity to the identity" i.e. for some $\phi :Z/12 \to Z/20$ we have $\phi(1) \to 1$.
...Right?
But my textbook proceed with $\phi(1) = x$ for $x \in Z/12Z$ as if it does not know what $1$, the identity of $Z/12Z$ is going to be mapped to via the homomorphism.
The rest of the proof follows from this assumption, but I'm just baffled with why this is an $x$...I'm just checking, the identity is $e$ such that $\forall a \in S$, a set, such that under the operation defined on $S$, $ae=ea=a$ right?
So under ordinary multiplication, I thought $1$, or technically, the elements of the equivalence class of $1$ are essentially the identity for both rings.
Am I missing something here? Or was it not a necessity that "a ring homomorphism maps the identity to the identity?"
I'm a bit confused here, might be missing something very basic, would be great if someone can clear it up!
 A: The term homomorphism means a lot of stuff in mathematics, but basically it is a map that preserves structure. The definition of an abstract ring does not require it to possess a multiplicative identity. So, abstract ring homomorphisms are not required to preserve identity (since it can be missing).
On the other hand, the definition of unital ring (also ring with identity) requires it to have a multiplicative identity; unital ring homomorphisms should then preserve it.
Note, that you can consider the same ring as a unital one or not, depending on the context (the latter is achieved simply by forgetting the existence of $1$).
Obviously, if the book supposes $\phi(1) = x$, it does not consider unital rings, so ring homomorphisms are not required to preserve $1$.
Usually texts on ring theory clearly state what do they call a ring and what a ring homomorphism.
A: There is no ring homomorphism from $\mathbb{Z}/12\mathbb{Z}$ to $\mathbb{Z}/20\mathbb{Z}$ that preserves identities. 
Indeed, since $12(1+12\mathbb{Z})=0+12\mathbb{Z}$ we would have $12(1+20\mathbb{Z})=0+20\mathbb{Z}$, which is false.
So probably your book doesn't require this property for ring homomorphisms.
If $\varphi\colon\mathbb{Z}/12\mathbb{Z}\to\mathbb{Z}/20\mathbb{Z}$ is a ring homomorphism (not preserving identities), then $\varphi(1+12\mathbb{Z})$ must be an idempotent of the codomain, so an element $x+20\mathbb{Z}$ such that


*

*$x^2-x\in20\mathbb{Z}$

*$12x\in20\mathbb{Z}$


It's better to first use the second properties, that says $x=5y$ for some $y$. Then we must have
$$
25y^2-5y\in20\mathbb{Z}
$$
so
$$
5y^2-y\in4\mathbb{Z}
$$
In other words, $5y^2-y\equiv0\pmod{4}$, which is the same as $y^2-y\equiv0\pmod{4}$. Then we get $y\equiv0$ or $y\equiv 1$ (modulo $4$).
In the first case we obtain $x\equiv0\pmod{20}$; in the second case $y=4z+1$ and $x=20z+5$. Thus the only possibilities are the zero homomorphism or $\varphi\colon a+12\mathbb{Z}\mapsto 5a+20\mathbb{Z}$.
