I'm trying to show directly that $p$ is prime in $\mathbb{Z}[i]$ if and only if $-1$ is not a square modulo $p$, using $\mathbb{Z}[x]$.
I see how to prove the result using the description of prime Gaussian integers (and using loads of intermediate results) but I read it can be proved directly using polynomials with integer coefficients and I don't see how...
I guess the idea is to prove that $<p>$ is a prime ideal but I get stuck on the actual procedure. Could you help me, I'm confused? Thank you very much!
First note that $\mathbb Z[i]/(p) \cong \mathbb Z[x]/(p,x^2+1)$ because $\mathbb Z[i] \cong \mathbb Z [x]/(x^2+1)$ and you can use the correspondence between ideals given by the isomorphism theorem: $(p)$ in $\mathbb Z[i]$ corresponds to $(p,x^2+1)$ in $\mathbb Z[x]$.
@Abellan has proved one direction. Here is the other direction:
Write $a^2=-1+pk$. Then $a^2+1 \in J=(p,x^2+1)$ and so $(x-a)(x+a)=x^2-a^2=(x^2+1)-(a^2+1) \in J$. But neither $x-a$ nor $x+a$ are in $J$.