Can the equality be proved like this?
(1) in case $x$ is positive (or equal to $0$), $\sqrt{x^2}$ is $x$.
(2) in case $x$ is negative, $\sqrt{x^2}$ is the positive number $-x$.
This tends to show that "$\sqrt{x^2}$" obeys the same conditions as $|x|$.
But I think it only rephrases what has to be proved, and does not really provide a justification.
In particular, how to explain (2)?
If $x$ is real, then $|x|$ is either $x$ or $-x$. Note that $|x|$ is always nonnegative.
So in any event, $|x|^2=x^2$.
Now $\sqrt{u}$ is defined to be the nonnegative number whose square is $u$. In particular, $\sqrt{x^2}$ is the nonnegative number whose square is $x^2$. We have just shown that this is $|x|$.