So I taught one-to-one functions in my class today and totally embarrassed myself with my explanation of trying to explain why you don't need to put $\pm$ on both sides for $$x_1^2 = x^2_2 \implies \pm x_1 = \pm x_2.$$
It doesn't tell the whole picture exactly. Why though? I was thinking about the following counterexample: $$(-3)^2 = (3)^2,$$ but I just got stuck trying to explain further. Why is this bad practice exactly?
Your example says that squaring of the both sides gives an equivalent equality iff both sides have the same sign.
Actually, $$x_1^2=x_2^2\Leftrightarrow x_1=x_2\vee x_1=-x_2$$ because $$x_1^2-x_2^2=(x_1-x_2)(x_1+x_2).$$