On the proof of $\;(1+x)^p\equiv1+x^p \pmod p$

$$(1+x)^p = 1+x^p$$ is true not only for $x\in \Bbb{F}_p$ but also for $x\in \Bbb{F}_p[t]$ or any commutative ring of charactistic $p$.

In contrary $a^p = a$ is true only for $a\in \Bbb{F}_p$ (as $t\ne t^p$ in $\Bbb{F}_p[t]$)


That's not only valid (albeit only for $\Bbb F_p$) but the neatest proof of it I've ever seen, much more cunning than using the binomial theorem (which, as @reuns & @JyrkiLahtonen noted, covers $\Bbb F_p(t)$ on a commutative ring of characteristic $p$).


I would read the congruence $$(1+x)^p\equiv1+x^p\pmod p$$ to involve polynomials in the ring $\Bbb{Z}[x]$.

Two polynomials $a(x)=a_0+a_1x+\cdots+a_nx^n$ and $b(x)=b_0+b_1x+\cdots+b_mx^m$ with integer coefficients are said to be congruent modulo $p$, if and only if $a_i\equiv b_i$ for all $i$ in the range $[0,\max\{m,n\}]$.

You must not think of $x$ as an integer. Instead, it is an indeterminate. Meaning that $x^p$ and $x$ are not congruent modulo $p$. For example their linear terms have coefficients $0$ and $1$ respectively. And $0\not\equiv1\pmod p$.

Observe that, by the binomial theorem, $$ (1+x)^p\equiv 1+x^p\pmod p $$ even though $x$ and $x^p$ are not congruent modulo $p$.


Another way to look at this is to say that by the binomial theorem we have the identity (not a congruence!) in the polynomial ring $\Bbb{Z}_p[x]$: $$ (1+x)^p=1+x^p. $$ Observe that, for example, in the polynomial ring $\Bbb{Z}_2[x]$ we don't have the identity $x=x^2$. The polynomial on the left has degree one whereas the polynomial on the right hand side has degree two.


Yet another way to see the difference is to let $x$ take values from e.g. the ring of Gaussian integers $\Bbb{Z}[i]$. For example, with $p=3, x=1+i$ we see that $$(1+i)^3=-2+2i.$$ This is not congruent to $(1+i)$ modulo $3$, so $x\not\equiv x^3\pmod 3$ for this choice of $x$. But, we have $$ (1+x)^3=(2+i)^3=2+11i $$ and $$ 1+x^3=1+(1+i)^3=-1+2i. $$ Their difference is $$ (1+x)^3-(1+x^3)=3+9i=3(1+3i) $$ a multiple of three. All in line with the congruence $$(1+x)^3\equiv1+x^3\pmod3.$$