Let $N:\mathbb{Z}{[i]} \rightarrow \mathbb{Z}$ be defined as $N(a+bi)= a^2+b^2$. Prove if $z \in \mathbb{Z}{[i]}$ such that $N(z)$ is a prime number then $z$ is irreducible.
I understand that by definition of function $N$ that the result of $N(z)= \text{prime}$. I also know that due to ring structure primes and irreducibility are related but not the same thing. How do I formally show that $z=ab$ for $a,b \in \mathbb{Z}{[i]}$ implies that either $a$ or $b$ is a unit?
Suppose that you have $ z=uv $, then $ N(z)=N(u) N(v) $, since $ N(z) $ is prime by hyphotesis, we get that either $ N(u) $ or $ N(v) $ is equal to $1$. Wlog, suppose that $ N(v)=1$, so if we write $ v=c+di $, we get $ c^2+d^2=1$. From that is easy to deduce that $ v $ is a unit. Therefore $ z $ is irreducible.