How do we factor polynomials that are in $\mathbb{Z}_m$ (congruence classes) I'm really confused, or maybe overthinking it, but how would I factor something like $x^4+2x-4$ in $\mathbb{Z}_5[x]$?

Let $P(x) \in \mathbb{Z}_5[x]$ with $P(x) = x^4+2x-4$
First we add $5$, which does not change $P(x)$. Then we notice that $x+1$ is a factor. $$P(x) = x^4 + 2x + 1 = (x+1)(x^3-x^2+x+1) = \boxed{(x+1)(x^3+4x^2+x+1)}$$
As Daniel Escudero states in a comment, determining that this second factor is irreducible is difficult. 
