Show that in the ring $\mathbb Z_n$ the divisors of zero are precisely those elements that are not relatively prime to $n$.
This is one of the problems in my quiz, I had proof but it's incomplete.
Proof: let $m$ be the element of $Z_n$ and $m\neq0$, and let the gcd of $m$ and $n$ be not equal to 1, say $d=\gcd(m,n) \neq1$. Then,
$m(\frac nd) = (\frac md)n$
thus $(\frac md)n$ gives 0 as a multiple of $n$. Hence $m(\frac nd) = 0$ in $Z_n$ this shows that neither $m$ nor $\frac nd$ is equal to zero, so $m$ is a 0 divisor.
This is where my proof ends, but my prof. was asking about the case when $\gcd(m,n) = 1$. I don't know what to do next I hope you could help me.