Prove that if $p$ is a prime in $\Bbb Z$ that can be written in the form $a^2+b^2$ then $a+bi$ is irreducible in $\Bbb Z[i]$ .
Let $a+bi=(c+di)(e+fi)\implies a-bi=(c-di)(e-fi)\implies a^2+b^2=(c^2+d^2)(e^2+f^2)\implies p|(c^2+d^2)(e^2+f^2)\implies p|c^2+d^2 $ or $p|e^2+f^2$ since $p$ is a prime.
How to show $e+fi $ or $c+di$ is a unit from here?
Hint: Use the norm $N(a+ib)=a^2+b^2$, $N(zz')=N(z)N(z')$, so if $zz'=a+ib$, $N(z)N(z')=p$ implies that $N(z)=1$ or $N(z')=1$, you deduce that $z$ is a unit or $z'$ is a unit.