Invertible or zero divisor in $\mathbb Z_n$ Is it true (for $n \le 10$) that every nonzero element in $\mathbb Z_n$ is either invertible or a zero divisor?
Can anyone please help me.
Thank you

This is true in $\mathbb Z_n$ for every $n$.
Consider $a\neq 0$ and look at the set of products
$$
P = \left\{\ ab \ \big|\ b\in\mathbb Z_n, b\neq 0\ \right\}.
$$
If $0\in P$, then $a$ is a zero divisor. If $1\in P$ then $a$ is invertible.
If $0,1\notin P$ we have $|P|\le n-2$, since there are $(n-1)$ different $b\neq 0$, there must be $b\neq b'$ with $ab=ab'$, thus
$$
a(b-b') = ab-ab' = 0,
$$
so $a$ is again a zero divisor.
