TITLE: If $\phi(\alpha)$ is prime in $\mathbb{Z}$, show that $\alpha$ is prime in $\mathbb{Z}[i]$
QUESTION [6 upvotes]: If $\alpha=a+bi$ is a Gaussian integer, let $\phi(\alpha)=a^2+b^2$. 

If $\phi(\alpha)$ is prime in $\mathbb{Z}$, show that $\alpha$ is prime in $\mathbb{Z}[i]$.

I use the idea that if $a^2+b^2=p$ where $p$ is prime number, then $\mathbb{Z}[i]/(a+bi) \cong \mathbb{Z}_p$. Hence, $(a+bi)$ is a maximal ideal since $\mathbb{Z}_p$ is a field. So, $(a+bi)$ is a prime ideal and hence $a+bi$ is a prime element.
Is this proof works?
EDIT: $\mathbb{Z}[i]/(a+bi) \cong \mathbb{Z}_p$ is proved in my class so I think I can straight away use it here. By the way, in the proof of $\mathbb{Z}[i]/(a+bi) \cong \mathbb{Z}_p$, my lecturer said that $a^2+b^2=p$ implies $\gcd(a,b)=1$. 
I can't figure out the proof of this. I start with contradiction, i.e. $d=\gcd(a,b)>1$. Then $d(\frac{a^2}{d}+\frac{b^2}{d})=p \implies d |p \implies d=p \implies a^2+b^2=\gcd(a,b)$, contradiction. Is this proof work ?

REPLY [3 votes]: Not only is your proof correct, it also avoids using the fact that $\def\Z{\mathbf Z}\Z[i]$ is a unique factorisation domain. This surprised me somewhat, but one does indeed have the following more general result.
Propostion. Let $n\in\Z$ be a non-square, and $R=\Z[\sqrt n]\cong\Z[X]/(X^2-n)$, and $\alpha=a+b\sqrt n\in R$ such that $\phi(\alpha)=a^2-nb^2$ is an irreducible integer (up to a sign a prime number). Then $\alpha$ is a prime element of$~R$ (which means $\alpha R$ is a prime ideal, or equivalently that $\alpha$ satisfies the property of Euclid's lemma).
Proof in several simple steps.

One has $\phi(xy)=\phi(x)\phi(y)$ for all $x,y$, because $\phi(a+b\sqrt n)=(a+b\sqrt n)(a-b\sqrt n)$.
So $\alpha$ cannot be invertible in $R$, as $p=\phi(\alpha)$ is not invertible in $\Z$.
$a$ and $b$ are relatively prime in $\Z$, since any for any common divisor $d$ the irreducible number $p$ is divisible by $d^2$, forcing $d^2=1$.
If $s,t\in\Z$ are Bezout coefficients with $\gcd(a,b)=1=sa+tb$, then $(t+s\sqrt n)\alpha\in\Z+1\sqrt n$, from which it easily follows that $\Z+\alpha R=R$.
Therefore the composite morphism $\Z\to R\to R/\alpha R$ is surjective.
The kernel of this composite morphism contains the irreducible number $p$ since $p=\alpha(a-b\sqrt n)\in\alpha R$, but it does not contain $1$ since $\alpha R\neq R$; therefore the kernel equals $p\Z$.
Then $R/\alpha R\cong\Z/p\Z$ is a field, $\alpha R$ is a maximal ideal of $R$ and in particular a prime ideal.

Your statement is of course the instance $n=-1$ of this proposition. My surprise was due to the fact that most instances of $\Z[\sqrt n]$ are not unique factorisation domains, and for them the property of being a prime element is much stronger than being irreducible.