How does squaring both sides of an equation lead to extraneous solutions? Let’s say I have $x = x + 1$, which is a false statment for real $x$; why can I solve for real $x$ when I square both sides of the equation, giving $x^2=(x+1)^2$?

An equality $e_1=e_2$, where $e_1$ and $e_2$ are expressions whose value is a number, means that the two expressions denote the same number.
You would of course expect that you if you apply the same function to two different representations of the same underlying number that you would therefore get the same result in both cases. This is a consequence of the usual notion of extensionality in mathematics. See e.g. https://en.m.wikipedia.org/wiki/Extensionality for more.
