An element $r\in R$ is called nilpotent if $r^n=0$ for some integer $n=1,2,\dots $.
We have the following:
- When $r$ is nilpotent then $1-r$ is invertible in $R$.
- If $R$ is commutative then the set $N(R)$ of nilpotent elements is an ideal of $R$. This is not true when the ring is not commutative.
I want to show that $N(\mathbb{Z}_m)=0$ if and only if $m$ is not divisible by a square of a prime.
Suppose that $N(\mathbb{Z}_m)=0$, then $r^n\neq 0$, for all $n\in \mathbb{N}$, where $r\in \mathbb{Z}_m$, right?
How could we continue?
It's not true that $m = ap^2 + 1$. That would imply that if $m$ is not divisible by the square of a prime, then $m - 1$ is. Consider $m = 2$.
If $m$ is not divisible by the square of a prime, then $m = p_1\ldots,p_t$ where the $p_i$ are distinct primes. Suppose $a \in \mathbb{Z}_m$ and $a^n = 0$. Then $m$ divides $a^n$, hence each prime factor $p_i$ of $m$ divides $a$. But then $m$ divides $a$, so $a = 0$. Hence $N(\mathbb{Z}_m) = 0$.