Let $p$ be a natural number, suppose $p$ prime. Show that the following conditions are equivalent:
the polynomial $x^2+1\in\mathbb{Z}_p$ has roots in $\mathbb{Z}_p$
$p$ is reducible in the ring $\mathbb{Z}[i]$
there exists $a,b\in\mathbb{Z}$ such that $p=a^2+b^2$
My attempt: suppose $x$ is a solution of $x^2=-1 \ mod\ p$. Raising both sides to $(p-1)/2$ gives $x^{p-1}=(-1)^{(p-1)/2}\ mod \ p$. Suppose $p$ congruent to $3$ modulo $4$. Then $(p-1)/2$ is odd and $(-1)^{(p-1)/2}=-1$, while $x^{p-1}=1$, a contradiction. Hence $p$ must be congruent to $2$ modulo $4$, i.e. $p=2$ or $p$ congruent to $1$ modulo $4$, i.e. $p=1+4n$, some $n$.
If $p=2$ then $p=(1+i)(1-i)$ is reducible. If $p=1+4n$ i can't see how to show reducibility.
For $2)\rightarrow 3)$, suppose $p=\alpha\cdot\beta$ with $\alpha,\beta$ gaussian integers. Then the norm of $\alpha$, say $a^2+b^2$, divides $p$, but $p$ is prime and the norm can't be $1$, because the factorization of $p=\alpha\beta$ is not trivial, hence $p=a^2+b^2$.
Again, for $3)\rightarrow 1)$, i really don't know what to do. Thanks for any help.