$n\geq 1$ be an integer and consider the ring $R=\mathbb{Z}/\mathbb{Z}_{n}$. First of all, we can see that the number of all the idempotents elements of $R$ is $2^m$, where $m$ is the number of distinct prime divisor of $n$.
$\textbf{Proof:} $Let $n=\prod\limits_{i=1}^{n} p_{i}n^{i}$ be the prime factorization of $n$ and $R_{i}=\mathbb{Z}/p_{i}^{n_{i}}$. By the Chinese Remainder theorem we have $R\cong R_{1}$ x $\cdots$ x $R_{m}$, say $(1)$.
$\textbf{Claim:} $ If $p$ is a prime and $l>0$ is an integer, then the only idempotent element of $\mathbb{Z}/p^{l}\mathbb{Z}$ are $0$ and $1$.
$\textbf{Proof:} $So we wnat to show that modulo $p^{l}$, the equation $x^{2}\equiv x$ (mod $p^{l})$ has only two trivial solutions $x=0,1$. Suppose that $x\neq 0$ is a solution of $x^{2}\equiv x$ (mod $p^{l})$. We will show that $x\equiv 1$ (mod $p^{l})$.
Let $x=p^{r}s$, where $0\leq r<1$, and gcd($s, p)=1$. Then $s(p^{r}s-1)\equiv 0$ (mod $p^{l-r})$ which give us $p^{r}s\equiv 1$ (mod $p^{l-r})$. Thus $r=0$ and hence $x\equiv s\equiv 1$ (mod $p^{l})$. It is clear now from (1) and claim that the number of idempotents of ring $R=\mathbb{Z}/\mathbb{Z}_{n}$ is $2^{m}$.
Now we can solve any question for $\mathbb{Z}/\mathbb{Z}_{n}$.
By the above $R=\mathbb{Z}/\mathbb{Z}_{20}$, we know that $R$ has $4$ idempotents, it is clear two of them being $0, 1$ (mod $20$). Let $R_{1}=\mathbb{Z}/\mathbb{Z}_{4}$, $R_{2}=\mathbb{Z}/\mathbb{Z}_{5}$. Then $R\cong R_{1}$ x $R_{2}$. All idempotents of $R_{1}$ x $R_{2}$ are $(0, 0)$, $(1, 0)$, $(0, 1)$, $(1, 1)$.
So we just need to find preimage of each idempotent in $R$. Obviously, the preimages of $(0, 0)$ and $(1, 1)$ are $0$ and $1$ (mod $20$) respectively. Now let let's find the preimage of, say $b=(0, 1)$. Let $a=m+20\mathbb{Z}$ be the preimage of $b$. Then the image of $a$ is $(m+4\mathbb{Z}, m+5\mathbb{Z})=b=(4\mathbb{Z}, 1+5\mathbb{Z})$. So $m$ divisible by $4$ and it is equiavlent to $1$ (mod $5$). It follows that $a=16+20\mathbb{Z}$. Similarly, we can find another idempotent 5 which is preimage of $(1,0)$.