If $f(x)\in\Bbb Z_p [x]$ is irreducible with $p$ prime and $\deg ⁡f(x)=n$ then $\Bbb Z_p [x]/〈f(x)〉$ is a field with $p^n$ elements. Suppose that $f(x)\in\Bbb Z_p [x]$ is irreducible, where $p$ is a prime. If $\deg ⁡f(x)=n$,show that $\Bbb Z_p [x]/〈f(x)〉$ is a field with $p^n$ elements.
I've seen plenty of cases, looking at a particular $p$ and a particular $f(x)$, but cannot seem to grasp the general solution.
 A: Clearly, $\mathbb{Z}_p[x]$ is a Euclidean domain. By the division algorithm, then,for each $q(x) \in \mathbb{Z}_p[x]$ there exists $a(x)$ and $r(x)$ such that $q(x) = a(x)f(x) + r(x)$ and $r(x)$ has degree less than n. Certainly then $\overline{q(x)} = \overline{r(x)}$. Moreover, $r(x)$ is unique.
Evidently then the number of elements of $\mathbb{Z}_p[x]/(f(x))$ is precisely the number of polynomials in $\mathbb{Z}_p[x]$ having degree less than n. Each such polynomial is uniquely determined by its coefficients, of which there are $n$, each taking one of the $p$ values in F. Thus $\mathbb{Z}_p[x]/(p(x))$ contains $p^n$ elements.
A: Hint : Since $f$ is irreducible, $\frac{\mathbb{Z}_p[x]}{(f(x))}$ is a field. By using division algorithm in $\mathbb{Z}_p[x]$ prove that $\frac{\mathbb{Z}_p[x]}{(f(x))}$ has dimension $n$ over $\mathbb{Z}_p$ and we are done.
A: Let $K=\mathbf{Z}_p[x]/f(x)$. Suppose $h(x)\in K$. We want to show that $h(x)$ has an inverse for all $h$. Since $K$ is a Euclidean domain, by Bézout's lemma we know that there exist $a(x)$ and $b(x)\in K$ such that $$f(x)a(x)+h(x)b(x)=1,$$ since $\gcd(f,h)=1$. If we consider this equation modulo $f(x)$ we get $$h(x)b(x)\equiv 1\pmod{f(x)},$$ which gives the desired inverse. It follows that $K$ is indeed a field.
Now, if $g\in\mathbb{F}_p[x]/f(x)$, then $\max(\deg g) = \deg(f)-1=n-1$. Thus, all elements in $\mathbb{F}_p[x]/f(x)$ are of the form $\displaystyle\sum_{i=0}^{n-1}a_ix^i$, for $a_i\in\mathbb{F}_p$ for all $1\le i\le n-1$. Since $|\mathbb{F}_p|=p$, and there are $n$ coefficients, there are $p^n$ ways to construct a polynomial in $\mathbb{F}_p[x]/f(x)$, so $|\mathbb{F}_p[x]/f(x)|=p^n$.
Thus $\mathbf{Z}_p[x]/f(x)$ is a field of $p^n$ elements
