Zero-Divisors & Units in $\mathbb{Z}/n\mathbb{Z}$ Let $n\in\mathbb{Z}_{\geq2}$. Considering the ring $\mathbb{Z}/n\mathbb{Z}$, we denote $(\mathbb{Z}/n\mathbb{Z})^*$ to be its ring of units. Furthermore, the map $\mathbb{Z}\to\mathbb{Z}/n\mathbb{Z};\,a\mapsto\overline{a}$ is meant to be the canonical projection modulo $n$.
claim 1: $\overline{a}\in\mathbb{Z}/n\mathbb{Z}$ zero-divisor $\iff$ $1<\gcd(a,n)<n$.
I am wondering if claim 1 is true or not. I was able to prove $''\implies''$ using Bézout as follows:
$$\gcd(a,n)=1\stackrel{\text{Bézout}}\iff\exists x,y\in\mathbb{Z}: ax+ny=1\iff ax\equiv 1\mod n \iff \overline{a}\in(\mathbb{Z}/n\mathbb{Z})^*.$$
So in particular $\overline{a}$ is not a zero-divisor.
If claim 1 is true, would it then imply the following proposition?
claim 2: $\overline{a}\in\mathbb{Z}/n\mathbb{Z}$ zero-divisor $\iff \overline{a}\notin(\mathbb{Z}/n\mathbb{Z})^*$
 A: Let $R$ be a finite ring. Then every non-zero element of $R$ is either a zero-divisor or a unit, but not both.
Proof: suppose that $a$ is a zero-divisor. Then clearly, $a$ cannot be a unit. For if $ab = 1$, and if we have $c \neq 0$ such that $ca = 0$, then we would have $cab = c1 = c = 0$. This is a contradiction.
On the other hand, suppose $a$ is not a zero-divisor. Then the map $x \mapsto a \cdot x$ is injective. For suppose we have $ax = ay$; then $a(x - y) = 0$; then $x - y = 0$; then $x = y$. Since this map is injective and its domain and codomain are both $R$, which is a finite set, the map must be surjective. Then there must exist $x$ such that $a \cdot x = 1$.
Thus, for $\overline{a} \neq 0$, we have $\overline{a}$ zero-divisor iff $\overline{a} \notin (\mathbb{Z} / n \mathbb{Z})^*$.
Now note that $\overline{a} \in (\mathbb{Z} / n \mathbb{Z})^*$ iff $gcd(a, n) = 1$. Clearly, if we have $\overline{a} \overline{x} = 1$, then $ax = 1 + bn$ for some $b \in \mathbb{Z}$, and thus $ax - bn = 1$, and thus $gcd(a, n) = 1$. And conversely, if $gcd(a, n) = 1$, then we have some $x, b$ such that $ax + bn = 1$. Then $ax = 1 - bn$. Then $\overline{a} \overline{x} = 1$.
Then $\overline{a}$ is a zero-divisor iff ($\overline{a}$ is not a unit and $\overline{a}$ is not zero) iff ($gcd(a, n) \neq 1$ and $gcd(a, n) \neq n$) iff $1 < gcd(a, n) < n$.
