Why is squaring an absolute value legitimate for algebraic manipulation? I was reading a math SE post following inequality with absolute value and found that it seemed to be common knowledge that you may square both sides of an absolute value function and it maintain correctness. 
For example:
$$
|x-5| = 1\\
(x-5)^2 = 1 \\
x^2-10x+24=0\\
(x-6)(x-4)=0\\
x=6 , x=4
$$
would be perfectly acceptable. Why does it work? Can someone provide intuition? 
 A: Squaring the equation $A=B$ to get $A^2=B^2$ can be a dangerous thing to do unless you are careful. The second equation is satisfied also by $A=-B$.
Here you are saved because $|x-5|=|5-x|$ - the absolute value effectively ignores/absorbs the sign (to write informally/intuitively)
You are right to be careful, though. If squaring makes things easier use it, but then check back that the solutions you find are also solutions of the original equation you were trying to solve.
Note: Squaring problems with absolute values can be useful, because it reduces the need to consider cases. Each absolute value gives you two cases to consider. Each squaring takes you from a linear equation to a quadratic (or something similar) and you get two solutions of a higher degree equation rather than two cases of lower degree.
A: This is because, on the one hand, (on $\mathbf R $) |x|^2=x^2, and  on the other hand $\sqrt{x^2}=|x|$, so the first two lines of the above calculation are equivalent.
A: $|x-5|=1$ equals
$x-5=1$ and $x-5=-1$
If you square $x-5=1$, you get $(x-5)^2=1$.
If you square $x-5=-1$, you get $(x-5)^2=1$.
Which proves $|x-5|=1$ gives $(x-5)^2=1$
A: It works because $$|A|=B \implies A^2=|A|\cdot|A|=B\cdot B=B^2$$
Note that the converse is not true, for example
$$3^2=(-3)^2 \not\Rightarrow 3=-3$$
Note also that for your example the solution can be obtained considering two cases by the definition of absolute value


*

*$x-5\ge0\implies x-5 = 1 \implies x=6$

*$x-5<0\implies -x+5 = 1 \implies x=4$

