$\sqrt{a}=\pm a$ for any $a$. $x^2$ always removes the negative, meaning that it will result in a positive number for $a$, but that doesn’t change the ambiguity of the square root operation. Thus I would think that $\sqrt{x^2}=\pm x$, where you select which output to use based on the problem in question, or leave it ambiguous if there is not enough information.
Yet in usage, it seems like the positive root is assumed if $a$ can be written as the square of something (ie $y=\sqrt{x^2+4x+4}=\sqrt{(x+2)^2}$ is assumed to have range $y\ge 0$). This would seem to contradict the definition, since ANY $a$, be it an equation or a number, can be considered the square of something and thus any use of the square root could be considered to be acting on a square.
What is going on here?