Let $a \in \mathbb{Z}[i]$ such that $N(a)$ is a prime or the square of a prime congruent to 3 modulo 4 in $\mathbb{Z}$. That is, $N(a)=p$ or $p^2$ where $p \equiv 3 \bmod 4$. Prove that $a$ is a prime element.
I know that if $N(a)$ is a prime then $a$ is prime as a Gaussian integer. How do I show that the ideal generated by $a$ is a prime ideal?
If I got you right, you are only missing the following conclusion:
If $N(a)=p^2$ with some prime number $p=3 \pmod 4$, then $a$ is prime in $\mathbb Z[i]$.
To the proof, notice that $\mathbb Z[i]$ is euclidean, in particular prime and irreducible coincide. Assume $a$ is not prime, hence reducible, say $a=bc$, $b,c$ non-units. We get $p^2=N(bc)=N(b)N(c)$. Since $b$ and $c$ are non-units, we get $N(b)=N(c)=p$. With $b = x+iy$, this gives rise to a sum of two squares: $p=x^2+y^2$. This is well known to be impossible for $p=3 \pmod 4$.