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]$ . 
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?
 A: 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.
A: Use different divides relations that you get from $a^2+b^2=(c^2+d^2)(e^2+f^2)$. You get that $c^2+d^2|p$ and $e^2+f^2|p$ which implies that one of $e+fi$ or $c+di$ them is a unit.
A: For what it's worth, I would rewind all the way back to the problem statement and go from there. Just my two cents.
If $p$ is a prime in $\textbf{Z}$ of the form $a^2 + b^2$ (with both $a, b \in \textbf{Z}$), it follows that $p$ is not prime in $\textbf{Z}[i]$ since $(a - bi)(a + bi) = p$. But you already knew that.
And you probably also already knew that the norm function is a multiplicative function. Given $\alpha$, $\beta$, both numbers in the ring at hand (pun fully intended), $N(\alpha \beta) = N(\alpha) N(\beta)$. From this we deduce that $$N \left( \frac{\alpha \beta}{\alpha} \right) = N(\beta), N \left( \frac{\alpha \beta}{\beta} \right) = N(\alpha)$$ and $$\frac{N(\alpha \beta)}{N(\alpha)}  = N(\beta), \frac{N(\alpha \beta)}{N(\beta)}  = N(\alpha).$$
All these norms are numbers in $\textbf{Z}^+ \cup \{ 0 \}$. Since $N(a + bi) = p$ is a prime number in $\textbf{Z}$, the only possibilities for $\alpha \beta = (a + bi)$ are for either $\alpha$ or $\beta$ to be a unit, since a prime in $\textbf{Z}^+$ is divisible only by $1$ and itself.
Let's work it out with a specific number, shall we? Take $10 + i$, with norm $101$. Check that $$\frac{10 + i}{1 - 10i} = i$$ and $$\frac{10 + i}{-1 + 10i} = -i.$$ As it happens, $10 + i$ is not divisible by either $10 - i$ nor $-10 + i$. But it's definitely not divisible by any number in $\textbf{Z}[i]$ with a norm other than $1$ or $101$.
