<s>[INST] prove or disprove $(x+1)^{2p^2}\equiv x^{2p^2}+\binom{2p^2}{p^2}x^{p^2}+1\pmod {p^2}$ The following question I read in a book, but the book does not give proof. I doubt the correctness of the result
let $p>3$ be prime number. prove or disprove
$$(x+1)^{2p^2}\equiv x^{2p^2}+\binom{2p^2}{p^2}x^{p^2}+1\pmod {p^2}\tag{1}$$
I think use binomial theorem
it maybe show $$\binom{2p^2}{k}\equiv 0,\pmod {p^2},k=1,2,\cdots,p^2-1,p^2+1,\cdots,2p^2-1\tag{2}$$
but  other hand I think (2) is not right.becuase let  $p=5,k=5$
we have $$\binom{2p^2}{k}=\binom{50}{5}=\dfrac{50\cdot 49\cdot 48\cdot 47\cdot 46}{5\cdot 4\cdot 3\cdot 2\cdot 1}\ne 0\pmod {25}$$,so I think $(1)$ is not right?
 [/INST] You got it right. By Lucas correspondence the congruence (1) would be correct if it were modulo $p$ only. If we did this modulo $p$ we would be doing arithmetic in the ring $\Bbb{Z}_p[x]$ — a commutative ring of characteristic $p$. This means that we can apply Freshman's Dream twice, and get
$$
\begin{aligned}
(x+1)^{2p^2}&=\left((x+1)^2\right)^{p^2}\\
&=\left((x^2+2x+1)^p\right)^p\\
&\equiv\left(x^{2p}+2^px^p+1\right)^p\pmod{p}\\
&\equiv\left(x^{2p}+2x^p+1\right)^p\pmod{p}\\
&\equiv x^{2p^2}+2x^{p^2}+1\pmod{p}.
\end{aligned}
$$
But, this is only modulo $p$.
Your example is the first failure modulo $p^2$. Well, the same way you would see that $\binom{18}3$ is not divisible by $9$, but the question specified $p>3$. Well done.
Kummer's theorem (see Qiaochu's link) says the same thing. When you do grade school addition of $5+45$ in base five there will only be a single carry, from the $5^1$-digit to the $5^2$-digit. Hence $\binom{50}5$ is divisible by $5^1$ but not divisible by $5^2$. For the same reason $\binom{2p^2}p$ is not divisible by $p^2$ for any prime $p>2$.
As the last observation, when $p=2$ the congruence (1) will be correct modulo $4$. For example the binomial coefficient $\binom 82$ is divisible by $2^2$ as $8$ has a non-zero bit at position $2^3$, and we get the required two carries when calculating $2+6$ in base two.
</s>