# Showing that $\mathbb{Z}_N$ is a field if $N$ is prime

I know that $N$ being prime is a necessary and sufficient condition for $\mathbb{Z}_N$ to be a field.

I know how to prove that it's necessary but I'm not sure how to prove that this is a sufficient condition on $N$.

Hint In this case, it's not too hard to check the field axioms directly. Alternately, one can show that $\langle p \rangle$ is a maximal ideal of $\Bbb Z$ for any prime $p$; in fact, this property is close to primeness.
The key is Bezout's identity. If $1\le n< N$ then $n$ and $N$ are coprime, and we have $$an+bN=1$$ for some integers $a$,$b$. Thererefore, $$an\equiv 1\pmod N$$
This proves that $n$ (or, more precisely, the class of $n$ mod $N$) has multiplicative inverse in $\Bbb Z_N$.
Hint: Prove that any non-zero element from $\mathbb{Z}_n$ has multiplicative inverse.
• Yes. Suppose that $\mathbb{Z}_n$ is field but $n$ is not prime. Let $m=a \cdot b.$ Then $a\cdot b=0$ in $\mathbb{Z}_n$ and $a$ ( or $b$) has no inverse. We get contradiction that $\mathbb{Z}_n$ is field. Thus $n$ must be prime. – Leox May 11 '15 at 15:50