[example: Failure of Unique Factorisation in Z[sqrt(-5)]]
We verify that $2$, $3$, $1 + \sqrt{-5}$, and $1 - \sqrt{-5}$ are all irreducible in $R = \mathbb{Z}[\sqrt{-5}]$.
The key tool is the **norm map**
\begin{align*}
N: \mathbb{Z}[\sqrt{-5}] &\to \mathbb{Z}_{\geq 0} \\
a + b\sqrt{-5} &\mapsto a^2 + 5b^2.
\end{align*}
This satisfies $N(\alpha\beta) = N(\alpha)N(\beta)$ for all $\alpha, \beta \in R$. Indeed,
\begin{align*}
N((a + b\sqrt{-5})(c + d\sqrt{-5})) &= N((ac - 5bd) + (ad + bc)\sqrt{-5}) \\
&= (ac - 5bd)^2 + 5(ad + bc)^2 \\
&= a^2c^2 - 10abcd + 25b^2d^2 + 5a^2d^2 + 10abcd + 5b^2c^2 \\
&= (a^2 + 5b^2)(c^2 + 5d^2) = N(\alpha)N(\beta).
\end{align*}
The units of $R$ are exactly the elements of norm $1$: if $\alpha\beta = 1$ then $N(\alpha)N(\beta) = 1$, so $N(\alpha) = 1$ (since both are non-negative integers). The only elements with $N(\alpha) = a^2 + 5b^2 = 1$ are $\alpha = \pm 1$.
Now we check irreducibility.
$N(2) = 4$. If $2 = \alpha\beta$ then $N(\alpha)N(\beta) = 4$, so the norms are $(1,4)$, $(2,2)$, or $(4,1)$. Could $N(\alpha) = 2$? That would require $a^2 + 5b^2 = 2$, which has no integer solutions (since $b \neq 0$ forces $5b^2 \geq 5 > 2$, and $b = 0$ gives $a^2 = 2$, impossible). So the only factorisation of $2$ has one factor with norm $1$, hence a unit. Thus $2$ is irreducible.
$N(3) = 9$. If $3 = \alpha\beta$ then $N(\alpha)N(\beta) = 9$. The only possibility for a non-unit factor is $N(\alpha) = 3$, requiring $a^2 + 5b^2 = 3$. Again $b \neq 0$ forces $5b^2 \geq 5 > 3$, and $b = 0$ gives $a^2 = 3$, impossible. So $3$ is irreducible.
$N(1 + \sqrt{-5}) = 1 + 5 = 6$. If $1 + \sqrt{-5} = \alpha\beta$ then $N(\alpha)N(\beta) = 6$, so we need $N(\alpha) \in \{2, 3\}$. But as shown above, neither $2$ nor $3$ is a norm in $R$. So $1 + \sqrt{-5}$ is irreducible. By the same argument, so is $1 - \sqrt{-5}$.
Finally, these four elements are genuinely different up to units: the only units are $\pm 1$, and $\pm 2 \neq \pm 3$, $\pm 2 \neq \pm(1 \pm \sqrt{-5})$, and $\pm 3 \neq \pm(1\pm \sqrt{-5})$. The two factorisations $6 = 2 \cdot 3 = (1+\sqrt{-5})(1-\sqrt{-5})$ are genuinely distinct.
[/example]