I am looking for irreducible polynomials to construct finite fields. In this case I need a degree $4$ irreducible polynomial over $\mathbb{Z}_3$. Is $f(x)=x^4+x+2$ irreducible over $\mathbb{Z}_3$? I don't have much practice proving the irreducibility of a polynomial. So I am not sure what I have done. It's okay?
First, I have that $f(x)$ has no roots in $\mathbb{Z}_3$. If $f(x)$ was reducible, noting that there are no $x^3$ term in $f(x)$. So the factorization could be $(x^2+2x+c)(x^2+x+d)$, where $c,d \in \mathbb{Z}_3$ ($2 \equiv -1 \pmod 3$). So, $$x^4+x+2=x^4+(c+d+2)x^2+(c+2d)x+cd$$ Then $c+d+2=0$, $c+2d=1$ and $cd=2$. But of the first two equalities I have to $d=0$, wich is impossible since $cd\neq 0$. Thus $f(x)$ is irreducible over $\mathbb{Z}_3$.
What you did is fine. Here is a conceptual overkill. First as $f(x)$ has no root in $\mathbb F_3$, if it's reducible, all its roots must be in $\mathbb F_9$, and the Galois group $G(\mathbb F_9/\mathbb F_3) = \{1, \rho\}$ where $\rho(x) = x^3$ is the Frobenius element. In particular, if $x\in \mathbb F_9\setminus \mathbb F_3$, its unique Galois conjugate is given by $\rho(x)=x^3$, therefore $x^4=x\cdot\rho(x)\in\mathbb F_3$. From the equation $x^4+x+2=0$, we get $x = -2 - x^4\in\mathbb F_3$, but we have already said $x\not\in\mathbb F_3$.
If you don't know Galois theory yet, note that $\mathbb F_9^{\times}$ is a (cyclic) group of order $8$, hence $x^8=1$ and $x^4=\pm 1\in\mathbb F_3$.