Example from Gallian: Let $f(x) = x^5+2x^2+2x+2\in Z_3[x]$. Then the irreducible factorization of $f(x)$ over $Z_3$ is $(x^2+1)(x^3+2x+2)$. So to find an find an extension $E$ of $Z_3$, in which $f(x)$ has a zero, we may take $E = Z_3[x]/<x^2+1>$, a field with nine elements or $E = Z_3[x]/<x^3+2x+2>$, a field with 27 elements.
I understand that $x+<x^2+1>\in Z_3[x]/<x^2+1>$ is s.t. $x+<x^2+1>$ is a zero of $x^2+1$ and is thus a zero of $f(x)$ in $E$. But I don't understand how I can see $E$ contains $Z_3$ and also how to see $Z_3[x]/<x^2+1>$ has nine elements and the other one with 27 elements. Thanks and appreciate hint.
$\Bbb Z_3$ is contained in $\Bbb Z_3[x]$ as the constant terms. They then get passed to the quotient $\Bbb Z_3[x]/I$ for some ideal $I$ as $0+I$, $1+I$ and $2+I$. So we say that $\Bbb Z_3$ is contained in $\Bbb Z_3[x]/I$, but what we mean is that the two canonical morphisms mentioned above are injective, and $\Bbb Z_3[x]/I$ contains a subring isomorphic to $\Bbb Z_3$.
As for the number of elements, consider the fact that any element in $\Bbb Z_3[x]/\langle x^2+1\rangle$ has a representative polynomial of degree one or zero (including the zero polynomial). And no two polynomials of degree one or zero represents the same congruence class. So the number of elements in $\Bbb Z_3[x]/\langle x^2+1\rangle$ is the same as the number of polynomials of degree one or zero.
The same goes for $\Bbb Z_3[x]/\langle x^3+2x+1\rangle$ and polynomials of degree two, one or zero.