Does Fermat's Little Theorem work on polynomials?

Let $p$ be a prime number. Then if $ f(x) = (1+x)^p$ and $g(x) = (1+x)$, then is $f \equiv g \mod p$?

I’m trying to prove that for integers $a > b > 0$ and a prime integer $p$, ${pa\choose b} \equiv {a \choose b}.$ To do this I use FLT to show that $(1+x)^{pa} \equiv (1+x)^a \mod p$ and compare the coefficients of $x^b$ to complete the proof. Am I applying FLT correctly?

In general, do most theorems regarding integers/reals generalize to polynomials over the integers/reals? Are there some common pitfalls that I could make when trying to generalize such theorems?

Solutions Collecting From Web of "Does Fermat's Little Theorem work on polynomials?"

The answer to the first question is NO. When you expand $g(x)$ by the binomial theorem, you will see that all of the coefficients, except for the first and last, are zero, so $g(x)$ is $1+x^p$ modulo $p.$ The difference between $f(x)$ and $g(x)$ has $p$ roots in the algebraic closure of $\mathbb{F}_p,$ which is not the same as the number of roots of the zero polynomial.

I think that gives an indication of the problems for your second question.

Possibly you have encountered a common stumbling point: confusing polynomial functions with formal polynomials. Over $\,\Bbb F_p,\,$ by $\,\mu$Fermat, $\,f-g\, =\, x^p -x \,$ equals the constant function $\,0,\,$ but it is not equal to $\,0\,$ as a formal polynomial since, by definition, formal polyomials are equal iff their corresponding coefficients are equal.