$Z_p[i]$ is a field? What are the conditions on prime p, under which the ring $Z_p[i]= {a+bi: a,b \in Z_p}$ where $i^2 =-1$, forms a field? For p=2,5,13 it is not a field while for p=3,7,11 it is a field. The following hint is given that it has to do with the equation x^2+1 =0 but I am not getting. I was rather thinking of the following forms of p: 4k+1, 4k+3 and 2.
 A: It is a field if $x^2 + 1$ is irreducible in $\mathbb{Z}/p\mathbb{Z}$. Because the degree of $x^2 + 1$ is two, this is exactly the case when $x^2 \equiv -1 \bmod{p}$ has no solution.
Then look up the formula for the Legendre symbol
$$ \left(\frac{-1}{p}\right) = \begin{cases} +1 & \text{ for } p \equiv 1 \bmod{4} \\ -1 & \text{ for } p \equiv 3 \bmod{4} \end{cases} \, .$$
Ok, you don't have to know the Legendre symbol $\left(\frac{a}{p}\right)$, just this: it is $+1$ if the equation $x^2 \equiv a\bmod{p}$ has a solution and $-1$ if it has no solution. So $\mathbb{Z}_p[i]$ is a field iff $p\equiv 3 \bmod 4$.
A: $x^2+1$ is reducible in $\mathbb{Z}_p$ $\iff$ $\exists$ $\alpha \in \mathbb{Z}^x_p$$= \mathbb{Z}_p \setminus \{0\}$ with $o(\alpha)=4$
$\mathbb{Z}^x_p$ is a cyclic group  of order $p-1$ ,
 so $\mathbb{Z}_p[i]$ is a field iff 4$\nmid$$p-1$.
That yields $p-1 \equiv a$ $mod$ $4$ with $a \neq 0$
If $a=1$ $\implies$  $p \equiv 2$ $mod$ $4$ $\implies$ $2 \mid p$ . But the only prime divisible by 2 is 2 itself and $x^2+1=(x+1)^2$ in $\mathbb{Z}_2$
If $a=3$ $\implies$  $p \equiv 0$ $mod$ $4$  and that's not possible.
so $a=2$
and $p \equiv 3$ $mod$ $4$ 
