TITLE: $\mathbb{F}_p[X]/(X^2+X+1)$ is a field iff $p \equiv 2 \bmod 3$
QUESTION [5 upvotes]: Let $p$ be a prime. Prove that $\mathbb{F}_p[X]/(X^2+X+1)$ is a field iff $p \equiv 2\bmod3$. 

So: 
If $p \equiv 2 $ mod $ 3$, I have to show that every element of $\mathbb{F}_p[X]/(X^2+X+1)$ has an inverse.
If $\mathbb{F}_p[X]/(X^2+X+1)$ is a field I have to show $p \equiv 2 $ mod $ 3$.

REPLY [4 votes]: Hint: The roots of $x^2+x+1$ over $\mathbb{C}$ are the non-trivial cube roots of unity. When does $\mathbb{F}_p$ have non-trivial cube roots of unity? (Think about the order of the multiplicative group $\mathbb{F}_p^\times$.) If the polynomial $x^2+x+1$ factors non-trivially, what would that imply about $\mathbb{F}_p[x]/(x^2+x+1)$? (Think about zero-divisors.) 
On the other hand, if there are no cube roots of unity in $\mathbb{F}_p$, then $x^2+x+1$ is irreducible (since it itself is only a degree $2$ polynomial, it can only factor into degree $1$ polynomials if it factors at all, and if there are no roots then it cannot have any factors of degree $1$). Since $\mathbb{F}_p[x]$ is a PID, this implies that the ideal $(x^2+x+1)$ is maximal, hence $\mathbb{F}_p[x]/(x^2+x+1)$ is a field.