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.