Note $\rm\:F[x]/(p(x))\:$ is a field $\iff$ $\rm\:(p(x))\:$ is maximal $\iff$ $\rm\:0\ne p(x)\:$ is prime $\iff$ $\rm\:p(x)\:$ is irreducible. Recall that PID's are one-dimensional, i.e. primes $\ne 0$ are maximal, and, further, since a PID is a UFD,$\ $ irreducible $\iff$ prime. In fact, PIDs are precisely the UFDs of dimension $\le 1$.
But a cubic $\rm\:f(x)\in F[x]\:$ is reducible iff it has root $\rm\in F\:,\:$ so for $\rm\: F = \mathbb Z/5\:$ you need only check if $\rm\ 0,\:\pm1,\:\pm2\ $ are roots of $\rm\:f(x)\:.$
As it turns out, $\rm\:x^3 + x + 1\:$ has no roots, but $\rm\:x^3-x+1\:$ has the root $-2$. Hence once you determine the correct polynomial, it is clear whether or not the quotient ring is a field.