I was reading a theorem in the book Contemporary Abstract Algebra by Gallian, and I have on thing that I do not completely understand. Namely, if the characteristic of $F$ is $p\ne 0$, then how does it so happen that $a_k=0$ if $p\nmid k$? For example, consider $a_k x^k$ over, say, $\mathbb{Z}_3$, and let $k=6$. Then $3\mid 6$, but $a_6 x^6$, with $a_6\ne 0$, but if $x=2\in \mathbb{Z}_3$ then $x^6 = 2^6 =64 = 1\ne 0\mod 3$. So how is the relevant statement in the proof justified? We don't seem to have $f(x)=a_0$ in this case, do we?
Here's the theorem and the proof in question:

Do you get to the place where we see that for $f$ to divide $f'$ we need $f'=0$, that is the polynomial $f'(x)$ is (identically) zero?
If so, that means $\bar{k} a_k=0$; which happens if and only if $\bar{k}=0$ or $a_k=0$. Here I have written $\bar{k}$ to remind you that the coefficients are in this case taken mod $p$.
So the only terms which can have have non-zero coefficients in $f(X)=\sum a_k X^k$ are the ones where $k$ is divisible by $p$, they are the ones where the $\bar{k}$ kills off the term automatically.