$a$ is an idempotent if $a^2=a$.
Show that $\mathbb{Z}_n$ always has an even number of idempotents.
Hint:
In any commutative ring, if $a$ is an idempotent, then $a'=1-a$ is an idempotent. These idempotents are orthogonal, i.e. $aa'=0$.
On the other hand, if $a'$ were equal to $a$, we would have $a^2=0$. This cannot be, as $a=a'\iff2a=1$, which implies $a$ is a unit.
Copyright © 2021 JogjaFile Inc.
Hint:
In any commutative ring, if $a$ is an idempotent, then $a'=1-a$ is an idempotent. These idempotents are orthogonal, i.e. $aa'=0$.
On the other hand, if $a'$ were equal to $a$, we would have $a^2=0$. This cannot be, as $a=a'\iff2a=1$, which implies $a$ is a unit.