How to prove $\bar{m}$ is a zero divisor in $\mathbb{Z}_n$ if and only if $m,n$ are not coprime Let us consider the ring $\mathbb{Z}_n$ where $\bar{m}\in\mathbb{Z}_n$
Could anyone help me prove that $\bar{m}$ is a zero divisor in $\mathbb{Z}_n$ if and only if $m,n$ are not coprime
So far I have:
Assume $\exists \bar{a}: \bar{m} \bar{n}=n \mathbb{Z} \Rightarrow$ for some $b\in\mathbb{Z}:am=bn$
I then assumed $n,m$ were coprime and attempted to use $\exists a',b'\in \mathbb{Z}:a'm+b'n=1$ to come to a contradiction, however haven't found one, the most promising thing I have found so far is that
$a=n(a'b+ab')$ and $b=m(a'b+ab')$ $\Rightarrow n|a$ and $m|b$
 A: You're almost there. Suppose that $m$ and $n$ are coprime and that $ma$ is a multiple of $n$. From $a'm+b'n=1$ you get $a'ma+b'na=a$. Then, $a$ is a multiple of $n$, that is $\bar a=\bar 0$ and $m$ is not a zero divisor.
A: Hint $\, $ Recall every element of a finite ring is either a unit or zero-divisor, e.g. see here or here. Thus the contrapositive equivalent of your statement is $\rm\,\gcd(m,n) = 1\,$ iff $\rm\:m\:$ is unit. By Bezout
$$\rm \gcd(m,n) = 1\iff\ \exists\ \: j,k\in\mathbb Z:\ j\ m + k\ n = 1\iff \ \exists\ \: j\in \mathbb Z:\ j\ m\equiv 1\ \ (mod\ n)$$
A: If $m$ is not coprime with $n$, let $b$ be their greatest common divisor. Then $m \frac{n}{b}$ is an integer multiple of $n$, so equals $0 \mod n$. Therefore $\bar m$ is a zero divisor (since $\frac{n}{b}$ is not equal to $0 \mod n$. 
Conversely, if $m$ is a zero divisor, we have $\bar m \bar k = 0 \mod n$ for some $k \not= 0 \mod n$, ie. $mk = nb$ for some integer $b$. We may take $b$ and $k$ to be less than or equal to $n$; since $k\not= 0 \mod n$, $k$ is striclty less than $n$. Therefore the least least common multiple of $n$ and $m$ is strictly less than $nm$. Hence $n$ and $m$ are not coprime.
A: Maybe you can divide this out into two cases, when $n$ is prime and when it is not.
Case 1:
If $n$ is a prime number then $\mathbb{Z}_n$ will be a commutative division ring with a unit, so if $ab \equiv 0 $ mod $p$ for $a,b \in \mathbb{Z}_n$, then this means that by euclid's lemma that $p$ divides $a$ or $p$ divides $b$ so that $a$ or $b$ are equivalent to zero mod $p$.
In particular since any element in $\mathbb{Z}_n$ will be coprime to $n$, no element in $\mathbb{Z}_n$ will be a zero divisor by the result above (Recall that an element $a \neq 0$ in a ring is a zero-divisor if $ab = 0$ for some $b \neq 0$ in the ring).
I think it makes no sense to talk of the other direction for the only time when a number $m$ is not coprime to a prime $n$ is when $m$ is a multiple of $n$, but this is ridiculous for such an $m$ is not in $\mathbb{Z}_n$.
Case 2: 
Suppose $n$ is not a prime number. Can you try to work this out for yourself?
