I have a stupid question. I just saw
$$\sqrt{2}^{p}\equiv \pm \sqrt{2}\pmod{p}$$
for all $p>2$ prime. In a sense, this is easy to verify. E.g. for $p=3$, we have $\sqrt{2}^3=2\sqrt{2}$ on the LHS, and $2\equiv -1\pmod{3}$.
But I still wonder what the underlying definition of congruence here is. Usually, one says $a\equiv b\pmod{c}$ iff $a-b=kc$, where $k$ is integral. But $\sqrt{2}^p\pm\sqrt{2}$ is never of the form $kp$ for an integral $k$.
There surely must be something very simple that I'm missing.
The meaning of the square root symbol can change if we are in a different field. Or, not the meaning, because that's the same. But the result changes.
For instance, modulo $7$, we have $3^2\equiv 2$, so in a sense $\sqrt2\equiv 3$ (or $4$, depending on which square root you pick; I'll go with $3$). Then we get $\sqrt2^7\equiv 3^7\equiv 3\equiv\sqrt2$ (you would get the same if you had gone with $4$).
In a field where $2$ doesn't have a square root, like modulo $5$, we have to adjoin a square root of $2$. This is done pretty much the same way we adjoin a square root of $-1$ when we construct the complex numbers from the real numbers: we introduce a symbol $\sqrt2$ (that's a single symbol in this case, not a square root operator and a numeral $2$), defined by the property that $\sqrt2^2 = 2$. Then we use it as the variable in polynomials the same way we would use, say, $x$, except that every time it's raised to a power of $2$ or greater, we are allowed to simplify. In this case, we get $\sqrt2^5 = \sqrt2^2\cdot \sqrt2^2\cdot\sqrt2 = 2\cdot 2\cdot \sqrt2\equiv -\sqrt2$.
Similar calculations may be done for any prime $p>2$.