Find an integer n that shows that the ring $\mathbb{Z}_n$ need not have the following property $a^2 = a$ implies $a \equiv 0 \pmod{n}$ or $a \equiv 1 \pmod{n}$.
This is my proof:
We will use $n=6$ for all of these. Namely, consider $\mathbb{Z}_6 = \{0, 1, 2, 3, 4, 5\}$. Recall that to prove that an implication “$P$ implies $Q$” fails, we need to find an example where $P$ is true and $Q$ is false. Consider $a=3$. Then $a^2 = 9 \pmod{6} \equiv 3 \equiv a$ but $3\not\equiv 0$ and $3\not \equiv 1$.
I was wondering if anybody can check my proof and see if it is correct. Thank you for your time it is greatly appreciated.