Prime number of ${\bf Z}$ and prime element of ${\bf Z}[i]$ I am looking at the class note from graduate number theory:
Let $p$ be prime number in ${\bf Z}$ and r be prime element in ${\bf Z}[i]$. If $r$ is an associate of $p$, then $p$ is congruent to $3$ modulo $4$.
I spent hours trying to understand the proof that follows this statement but I could not make out anything. I dare not ask my professor since typically he will come back with more complicated proof written solely in his own terms. Any explanation in friendly term will be very much appreciated.
Thank you very much for your time.
 A: An element $z=a+ib\in {\bf Z}[i]$ is prime if and only if either one of $a,b$ is zero and the other is a prime congruent to $3$ modulo $4$; or $Nz$ is a prime.
Thus, you want to show a part of this theorem, namely that if $z=\pm p$ or $\pm pi$ is prime, then $p=3\mod 4$. But by Fermat's theorem on two squares, if $p=1\mod 4$, we can write $p=x^2+y^2$. This factors in ${\bf Z}[i]$ as $(x+iy)(x-iy)$, so $z=\pm(x+iy)(x-iy)$ or $z=(ix-y)(ix+y)$ and no factor is a unit since the norms are not one. 
A maybe simpler proof is as follows. Suppose $p=1\mod 4$. By Wilson's theorem, $(p-1)!=-1\mod p$. Grouping the terms in the product appropriately we get $$(-1)^{\frac{p-1}2}\left(\frac{p-1}2\right)!^2  =-1\mod p$$; so $p\mid x^2+1$, $x\in {\bf Z}$. It follows that in ${\bf Z}[i]$, $p\mid (x-i)(x+i)$. If $p$ were prime, we would have $p\mid x-i$ or $p\mid x+i$. But this is impossible, for there is no integer such that $pr=1$, and the last remark would give $p(a+ib)=pa+pbi=x\pm i$.
ADD This gives a proof of Fermat's theorem! The above gives $p$ is not irreducible, and of course it is not a unit, so it factors nontrivially as a product of two Gaussian non-unit integers $p=wz$. Then $Np=p^2=NwNz$, and since $Nw,Nz>1$; $Nw=Nz=p$, and $p$ is a sum of two squares.
