Finding ring homomorphisms $\mathbb{Z}\to\mathbb{Z}/n\mathbb{Z}$

A problem from D&F Abstract Algebra: find all ring homomorphisms $\mathbb{Z}\to\mathbb{Z}/30\mathbb{Z}$. Homomorphisms of general rings are assumed (not rings with unity).

My reasoning is as follows. Suppose $\varphi\colon\mathbb{Z}\to\mathbb{Z}/n\mathbb{Z}$ is a homomorphism. Any homomorphism from $\mathbb{Z}$ is uniquely determined by the image of $1$. Now, if $\varphi$ maps $1$ to $x\in\mathbb{Z}/n\mathbb{Z}$, then $x=\varphi(1)=\varphi(1)^2=x^2$, so $x$ is an idempotent. Conversely, if $x=x^2$ in $\mathbb{Z}/n\mathbb{Z}$, then the map $1\mapsto x$ extends to a homomorphism: $\forall a,b\in\mathbb{Z}\;\varphi(ab)=abx=abx^2=axbx=\varphi(a)\varphi(b)$. In the case $n=30$ one can find idempotents by hand, though the Chinese Remainder Theorem is of great help.

Here is my question: the CRT is not stated until 2 sections later in the book, so, did they mean the brute force solution of checking all elements for idempotence? Or is there a less computational (but elementary) approach?

• $x$ has to satisfy $x(x-1)=30k$ for some $k$, which cuts down the number of values you have to check a bit? Feb 19, 2018 at 1:57
• Nice! I am still wondering if there is a more "conceptual" solution.. Feb 19, 2018 at 2:06
• @lanskey: The "conceptual" solution is to use the CRT.
– user14972
Feb 19, 2018 at 2:50

You only need to check those $x$ which have $0$, $1$, $5$ or $6$ as their last digit, because those are the only last digits which are preserved under squaring, and therefore also under squaring modulo $30$.
This is, of course, the CRT (or part of it) in disguise, but in a form that should be easy to understand for someone who hasn't seen the CRT before, and it doesn't require the formal statement of the CRT. The disadvantage of working with digits is that it only works when the modulus is a multiple of $10$, but trying to generalize it to other moduli could be used as a nice motivation for the CRT.