> [!NOTE] **Theorem** ($\mathbb{Z}/p\mathbb{Z}$ is a field)
> Let $n\in \mathbb{N}_{\geq 2}.$ Then the [[Integers Modulo n|ring of integers modulo n]] $\mathbb{Z}/n\mathbb{Z}$ is a [[Field (Algebra)|field]] iff $n$ is a [[Prime Numbers|prime]].
###### Proof
($\implies$) Suppose $n\geq 2$ is prime. Let non-zero $[a]_{n} \in \mathbb{Z} \text{/}n \mathbb{Z}$ is a unit. Consider the sequence $[a]_{n},[2a]_{n},\dots,[na]_{n}$. These are distinct since $ar_{1}\equiv ar_{2}\implies a(r_{1}-r_{2})\equiv{0}\pmod{n}$ and so $r_{1}\equiv r_{2} \pmod{n}$ since $a\not \equiv 0$. The sequence is therefore some rearrangement of $[1]_{n},[2]_{n},\dots[n]_{n}$ and so $[1]=[2k]_{n}$ for some $1 \leq k\leq n$.
We can also prove this by considering the fact that sequence $a,a^2,\dots$ must have a repetition since $\mathbb{Z}/n\mathbb{Z}$ is finite or by applying [[Extended Euclidean Algorithm|Euclid's algorithm]] since $\gcd(a,n)=1$.
($\impliedby$) Conversely, suppose $n$ is composite. Hence there exists $1<a < n$ such that $a \mid n \implies \text{gcd}(a,n) = a > 1$ . By [[Unit in Integers Modulo n]], $[a]_{n}$ is not a unit. Hence $\mathbb{Z} \text{/} n \mathbb{Z}$ is not a field.
###### Proof
($\implies$) Suppose $p \geq 2$ is a prime. Since [[Finite Integral Domains are Fields|a finite integral domain is a field]], it is sufficient to show that $\mathbb{Z}/p\mathbb{Z}$ is an integral domain. Let $a,b\in \mathbb{Z}$ such that $ab \equiv 0\pmod{p}.$ Then $p\mid ab$ and by [[A Prime that Divides a Product of Integers Must Divide At Least On Factor (Euclid's Lemma)|Euclid's lemma]], $p\mid a$ or $p\mid b$ and we are done.
$(\impliedby)$ Suppose $n$ is composite. Then $n =ab$ for some $2\leq a,b < n.$ Since [[Fields and Their Subrings are Integral Domains|fields are integral domains]], it is sufficient to show that $\mathbb{Z}/n\mathbb{Z}$ is not an integral domain. This is true since $ab \equiv 0 \pmod{n}$ and neither $a$ or $b$ equal $0$ modulo $n$, that is $a,b$ are zero divisors.