GCD and prime factorization in $\mathbb{Z}_3$ This is a past exam question.
Let $I$ be the ideal of $\mathbb{Z}_3[X]$ and $I$ is generated by the polynomials 
$$f=X^4+X^3+X+2 \space\space\space \text{and} \space\space\space g=X^4+2X^3+2X+2$$
(a) Calculate a gcd for $f$ and $g$ in $\mathbb{Z}_3[X]$.
(b) Show that $X^4+2$ is an element if $I$.
(c) Show that $E=\mathbb{Z}_3[X]/I$ is a field.
(d) Find the prime factorizations of $X^4+2$ in $\mathbb{Z}_3[X]$ and $E[x]$

(a) Since $\mathbb{Z}_3$ is a small filed, so I test all the elements on $f$ and $g$ to see will it gives me a zero, and the answer is no. Hence they don't have factors in $\mathbb{Z}_3[X]$ meaning that they are irreducible in $\mathbb{Z}_3[X]$ and $ $gcd$(f,g)=1$.
(b) Since $I$ is generated by $f$ and $g$, if $X^4+2 \in I$ we must have 
$$X^4+2 = a(X^4+X^3+X+2)+b(X^4+2X^3+2X+2) \space\space\space\space\space\space \text{for some} \space a \space \text{and} \space b \space \in \mathbb{Z}_3 $$
Solve for $a$ and $b$, we get 
$$a+b=1 \space \text{and} \space a+2b=0$$
Hence $a=2 $ and $ b=2$. So $X^4+2$ is an element of $I$.
(c) $\mathbb{Z}_3$ is a field $\Rightarrow \mathbb{Z}_3[X]$ is a field, so if I can show that $I$ is a maximal ideal in $\mathbb{Z}_3[X]$ (which I don't know how to do) I can conclude that $\mathbb{Z}_3[X]/I$ is a field.
(d) In $\mathbb{Z}_3[X]$ we know that when $X = 1 $ or $ 2$, $X^4+2=0$. So $X+1$ and $X+2$ are a factor of $X^4+2$. By long division, we can show that $X^2+1$ is also a factor. Hence $X^4+2=(X+1)(X+2)(X^2+1)$ in $\mathbb{Z}_3[X]$. But I don't know what the filed $E$ look like, so cannot do the same as what I did with $\mathbb{Z}_3$ (i.e. putting $X=0,1,2$ and see will it gives me a zero).
 A: For (a), you have shown that neither polynomial has a linear factor.  However they might have a common quadratic factor, and in fact by using the Euclidean algorithm you can show that the GCD is $X^2+1$.
Your answer for (b) has worked out correctly, though you should have considered the possibility of $X^4+2$ being a polynomial times $f$ plus a polynomial times $g$.  Alternatively, $X^4+2$ is a multiple of the gcd $X^2+1$.
For (c), use the fact that $I$ is generated by $X^2+1$, which is irreducible over $\Bbb Z_3$.
For (d) your factorisation in $\Bbb Z_3[X]$ is correct, but an easier way to do it is
$$\eqalign{X^4+2
  &=X^4-1\cr
  &=(X^2-1)(X^2+1)\cr
  &=(X+1)(X-1)(X^2+1)\cr
  &=(X+1)(X+2)(X^2+1)\ .\cr}$$
A: For $(d)$ note  $\, E\, =\, \Bbb Z_\color{#c00}3[x]/(x^2+1)\, =\, \Bbb Z_\color{#c00}3[\,i],\ $ where $\ \color{#0a0}{i^2 = -1}.\,$ Therefore in $\,E[X]\,$ we have $$\,X^4\!+2\,\overset{\large\color{#c00} 3\, =\, 0} =\, X^4\!-1\, =\, (X^2-1)(\underbrace{X^2\color{#0a0}{+1}}_{\Large X^2 \color{#0a0}{-\ i^2}})\, =\, (X-1)(X+1)(X-i)(X+i)$$
The extension $\,E\,$ is precisely that needed to split the underbraced irreducible factor $\,X^2+1.\,$  To split it, it suffices to adjoin either root of $\,X^2+1,\,$ i.e. any square root of $\,-1.$
