In $\Bbb Z/m\Bbb Z,$ if $a$ is not invertible then it is a zero divisor 
Let $m$ be a positive integer, and $a$ an integer. How can I prove that if $a$ is not a unit in $\mathbb{Z}/m\mathbb Z$, then $a$ is a zero divisor in $\mathbb {Z}/m\mathbb Z$ ?

I am stuck on this problem I would appreciate a lot your help thanks!!
 A: Suppose $a$ is not a unit.
Then $\gcd(a,m)=d\ (>1)$.
Then, $\left(\frac{m}{d}\right)\cdot a=0\ (\mod m)$.
Thus, $a$ is a zero divisor.
A: Hint $ $ unit $a\!\iff\! x\mapsto ax$ onto $\!\iff\! x\mapsto ax\,\ 1\!-\!1\!\iff\! a$ cancellable $\!\iff\! a$ not zero-divisor
See also the following.
Theorem $\ $ The following are equivalent for integers $\rm\:c,\, m.$
$(1)\rm\ \ \ gcd(c,m) = 1$
$(2)\rm\ \ \ c\:$ is invertible $\rm\,(mod\ m)$
$(3)\rm\ \ \ x\to cx+d\:$ is $\:1$-$1\:$ $\rm\,(mod\ m)$
$(4)\rm\ \ \ x\to cx+d\:$ is onto $\rm\,(mod\ m)$ 
Proof $\  (1\Rightarrow 2)\  $ By Bezout $\rm\, gcd(c,m)\! =\! 1\Rightarrow cd\!+\!km =\! 1\,$ for $\rm\,d,k\in\Bbb Z\,$ $\rm\Rightarrow cd\equiv 1\!\pmod{\! m}$
$(2\Rightarrow 3)\ \ \ \rm cx\!+\!d \equiv cy\!+\!d\,\Rightarrow\,c(x\!-\!y)\equiv 0\,\Rightarrow\,x\!-\!y\equiv 0\,$ by multiplying by $\rm\,c^{-1}$
$(3\Rightarrow 4)\ \  $ Every $1$-$1$ function on a finite set is onto (pigeonhole).
$(4\Rightarrow 1)\ \ \ \rm x\to cx\,$ is onto, so $\rm\,cd\equiv 1,\,$ some $\rm\,d,\,$ i.e. $\rm\, cd+km = 1,\,$ some $\rm\,k,\,$ so $\rm\gcd(c,m)=1$
See here for a conceptual proof of said Bezout identity for the gcd.
A: Let's write $R=\Bbb Z/m\Bbb Z$, and consider $a\in R$.
If $ar\neq as$ for all $r,s\in R$ $r\neq s$, then $\{ar\mid r\in R\}=R$, so there's an element $r$ such that $ar=1$, and $a$ is a unit.
If we require $a$ to be a nonunit, then the above case cannot happen and so there exists $r,s\in R$ such that $ar=as$ but $r\neq s$.
Can you see how to extract $t\neq 0$ such that $at=0$ from this?
A: Answer: Here is an approach using the Chinese Remainder Theorem where you get more information on the units: What are they? If $b=p_1^{l_1}\cdots p_d^{l_d}$ is a product of powers of $d$ distinct primes, it follows by the CRT there is an isomorphism of rings
$$i1.\text{  }A:=\mathbb{Z}/b\mathbb{Z} \cong \mathbb{Z}/p_1^{l_1}\mathbb{Z} \oplus \cdots \oplus \mathbb{Z}/p_d^{l_d}\mathbb{Z}:=A_1\oplus \cdots \oplus A_d.$$
The CRT says that if $I_i$ is a set of coprime ideals in a commutative ring $A$, there is an isomorphism
$$\phi:A/I_1\cdots I_d \cong A/I_1 \oplus \cdots \oplus A/I_d$$
of rings with $\phi(a):=(a,a,..,a) \in \oplus_i A/I_i$. You find a proof in Atiyah-Macdonald or Matsumura's books on commutative algebra.
In your case, if $p\neq q \in \mathbb{Z}$ are distinct prime numbers, it follows their corresponding maximal ideals $(p),(q)$ are coprime. Moreover for any integers $l,k \geq 1$ it follows $(p^l),(q^k)$ are coprime, and this implies the isomorphism in $i1$.
Example: In general for any prime $p$ and any integer $l \geq 1$ it follows the ring $\mathbb{Z}/p^l\mathbb{Z}$ is a zero dimensional local ring with maximal ideal $\mathfrak{m}:=(\overline{p})$. Hence the units $A^*$ equals $A-\mathfrak{m}$ and the zero divisors (and nilpotent elements) equals $\mathfrak{m}$. Hence in the direct sum decomposition $A \cong \oplus_i A_i$ it follows an element $m:=(m_1,..,m_d)$ with $m_i \neq 0$ for all $i$ is a zero divisor iff $m_i \in \mathfrak{m}_i$ for all $i$. Any non-zero element $m:=(m_1,..,m_d)$ with $m_i=0$ for some $i$ is a zero divisor.
An element $m$ is a unit iff $m_i\in A_i^*$ for all $i$.
Question: "Let m be a positive integer, and a an integer. How can I prove that if a is not a unit in Z/mZ, then a is a zero divisor in Z/mZ ?"
Answer: Hence $m$ is a unit iff $(m,p_i)=1$ for all $i$ - this gives an explicit formula for the units in your ring in terms of the prime factorization $b:=p_1^{l_1}\cdots p_d^{l_d}$. Once you know such a factorization you know all units.
If $0\neq m$ is a non-unit, it follows $(m,p_i)\neq 1$ for some $i$ hence $m=np_i^{a_i}$ where $(n,p_i)=1$, and $mp_1^{l_1}\cdots p_i^{l_i-a_i}\cdots p_d^{l_d}=0$ hence $m$ is a zero divisor. Hence in $A$ any element is either a unit or a zero divisor.
Example: If $A:=\mathbb{Z}/6\mathbb{Z}$ it follows
$$\phi: A\cong \mathbb{Z}/2\mathbb{Z} \oplus \mathbb{Z}/3\mathbb{Z}:=A_1\oplus A_2 $$
and $\phi(3)=(3,3) \cong (1,0)$. The element $(1,0)\in A_1 \oplus A_2$ is a zero divisor.
