TITLE: Why can I square both sides?
QUESTION [11 upvotes]: I am not used to English. I ask for your understanding in advance.
There is the equation:
$ x= 2^\frac{1}{2}$
we can square both side like this:
$ x^2= 2$
But I don't understand why that it's okay to square both sides.
What I learned is that adding, subtracting, multiplying, or dividing both sides by the same thing is okay. For example:
$ x = 1 $
$ x-1 = 1-1 $
$ x-1 = 0 $
$ x \times 2 = 1 \times 2 $
$ 2x = 2 $
like this.
But how come squaring both sides is okay too?
$ x = 2 $
$ x \times 2 = 2 \times 2 $
$ 2x = 4 $
$ 2x \times x = 4 \times x $
This does not induce it.
Can you answer this silly question?

REPLY [5 votes]: The reason for this is that the operations you describe - squaring, addition, and the like - are all functions, and functions have the general property that if $a = b$, then $f(a) = f(b)$, where $f$ is the function in question. One can consider this the quintessential defining aspect of a function: that it relates each input unambiguously to an output, so when you give it the same input on two different occasions or in two different forms, like on the two sides of the equation, it must give you the same output in both instances.
Unfortunately, the idea of functions tends to get introduced rather late, which is more like history than it is like the logical structure of modern maths. Functions are actually one of the most basic and elementary concepts in maths, and you have been using them ever since you did addition.