Abstract algebra for $\mathbb Z_p[i]$ form a field For which value of $p$ does the ring $\mathbb Z_p[i]$ form a Integral domain? The answer is $p=4k+3$, where $k$ is an integer - but why? I do not understand.
 A: To see why $p = 4k+1$ is impossible recall that every prime of that form can be written as a sum of two squares. So we have that:
$$p = a^2 + b^2 = (a + ib)(a - ib)$$
So in $\mathbb{Z}_p[i]$ we have that $a+ib, a-ib$ are zero divisors, so it can't be an integral domain.
Now it remains to prove that it's an integral domain for each $p=4k+3$. Assume it's not true, i.e. $a+ib$ is a zero divisor. Then for some $c+id \not = 0$ we have that
$$(a+ib)(c+id) = 0 \quad \text{ in } \mathbb{Z}_p[i]$$
This reduces to the equations:
$$ac - bd \equiv 0 \pmod p$$
$$ad + bc \equiv 0 \pmod p$$
As $a+ib$ is a zero divisor at least one of $a,b$ isn't $0$ in $\mathbb{Z}_p$. WLOG let it be $a$. Then we have that $ c \equiv bda^{-1} \pmod p$ and substituting in the second equation we get:
$$ad + b^2da^{-1} \equiv 0 \pmod p$$
Obviously $d$ can't be $0$, as the first equation gives us that $c=0$ in $\mathbb{Z}_p$. So we can get rid of $d$ and multiply both sides by $a^{-1}$ to get that:
$$(ba^{-1})^2 \equiv -1 \pmod p$$
But for $p=4k+3$, this equation has no solution, as $-1$ isn't a quadratic residue modulo $p$. Hence such a zero divisor doesn't exists and $\mathbb{Z}_p[i]$ is an integral domain.
A: This depends on whether $-1$ is a quadratic residue mod $p$.
If $-1\equiv a^2 \pmod{p}$ for some $a \in \Bbb Z$, then $a^2+1 \equiv 0 \pmod{p}$, so $(a+i)(a-i) = 0$ in $\Bbb Z_p[i]$.
On the other hand, if the equation $-1 \equiv a^2 \pmod{p}$ has no solution for some $p$, then the polynomial $x^2+1$ has no root over $\Bbb Z_p$, so it is irreducible (because the degree is $2$), thus $\Bbb Z_p [x]/(x^2+1) \cong \Bbb Z_p[i]$ is an integral domain (and even a field).
So we need to determine the $p$ such that $-1$ is a square mod $p$.
There are multiple ways to do this: one is to use Euler's criterion: $\left( \frac{-1}{p}\right) \equiv (-1)^\frac{p-1}{2} \pmod{p}$, from this we get that $\left( \frac{-1}{p}\right) = 1$ if $p \equiv 1 \pmod{4}$ and $\left( \frac{-1}{p}\right) = -1$ if $p \equiv -1 \pmod{4}$.
Another way is to use the fact that the mulitplicative group $\Bbb Z_p^\times$ is cyclic and has order $p-1$, so it contains an element of order $4$ iff $ 4 \mid p-1 \Leftrightarrow p \equiv 1 \pmod{4}$. Now any element such that $a^2 \equiv -1 \pmod{4}$ must have order $4$ in $\Bbb Z_p^\times$ and conversely, any element $a$ of order $4$ satisfies $a^2 \equiv -1 \pmod{4}$, because $-1$ is the unique element of order $2$ in $\Bbb Z_p^\times$.
