Factor $g(x) = x^3 - x^2 -x - \overline{2} \in \mathbb{Z}_5$ into a product of irreducible polynomials in $\mathbb{Z}_5$ 
Problem: Factor $g(x) = x^3 - x^2 -x - \overline{2} \in \mathbb{Z}_5$ into a product of irreducible polynomials in $\mathbb{Z}_5$.

Could you give me some hint to solve this problem. Thank all!
 A: Hint: $2$ is a root.  So $(x-2)$ is a factor. 
So write $(x-2)(x^2+ax+b)=x^3-x^2-x-2$, and solve for $a$ and $b$.
Get:  $-2+a=-1 \,,-2a+b=-1$ and $-2b=-2$.
So, $a=1,b=1$.
A: Since $g$ is a polynomial of degree $3$ it is reducible, if it has a root. 
Checking for roots is simple, since $\mathbb{Z}_5$ only has five elements.
So we could just calculate $g(x)$ for $x=0,1,2,3,4$. 
But it is sufficient to check the divisors of $2$ which are $\pm 1,\pm 2$ (which does not help much, it just tells us, that 0 is not a root, what is obvious) Note, that we have -1=4 and -2=3 in $\mathbb{Z}_5$
We see that x=2 is a root, since
$g(2)=2^3-2^2-2-2=8-4-2-2=0$
We proceed with long division:
$(x^3-x^2-x-2)\div (x-2)=x^2+x+1$
$h(x)=x^2+x+1$ is irreducible. If it is reducible, it has a root.
Checking all five elements of $\mathbb{Z}_5$ shows, that this has indeed no root, so we found our factorisation.
$(x^2+x+1)(x-2)=x^3-x^2-x-2$
Note, that we just checked if the occuring polynomials have roots (since the degree is $\leq 3$), so what we did are just basic methods. There is nothing special here, and you do not have to be confused by $\mathbb{Z}_5$, which is a finite field. 
It actually helps!
