proving the characteristic of idempotent in ring Let $R$ be a ring, let $I$ be an ideal of $R$, and let $u\in R$ be idempotent modulo $I$ (that is, $u^{2}-u\in I$). Then $u$ can be lifted to an idempotent in $R$ in case there is an idempotent $e$ in $R$ with $e-u \in I$.  
I want to show that :  
Let $n > 1$ in $\mathbb{N}$. Prove that if $n$ is not a power of a prime, then there 
 exist idempotents modulo $n\mathbb{Z}$ in $\mathbb{Z}$ that cannot be lifted to idempotents in $\mathbb{Z}$

If $n$ is not a prime power, then you can write $n=ab$ with $a,b\gt 1$, $\gcd(a,b)=1$. 
By the Chinese Remainder Theorem, there exists $x\in\mathbb{Z}$ such that $x\equiv 0\pmod{a}$ and $x\equiv 1\pmod{b}$. Since $x^2\equiv 0\equiv x\pmod{a}$ and $x^2\equiv 1\equiv x\pmod{b}$, it follows that $a|x^2-x$ and $b|x^2-x$, and since $\gcd(a,b)=1$, then $n|x^2-x$. Thus, $x$ is an idempotent modulo $n\mathbb{Z}$.
Now show that neither  $0-x$ nor $1-x$ are in $n\mathbb{Z}$. 
