This question has the potential to sound extremely stupid, but I've seen (and also used) countless times the idea that $\sqrt{x^2} = x$. However $x^2 = x\cdot x = (-x)\cdot(-x)$.
I know that when taking the square root of something we take both the positive and negative root. Yet when solving an equation and we're faced with $\sqrt{x^2y}$ we make it $x\sqrt{y}$. Why didn't we consider $(-x)\sqrt{y}$? Similarly, $\sqrt{x^3}$ is often changed to $x\sqrt{x}$ and not $(-x)\sqrt{-x}$ which would still give the same result if cubed? (I do understand that the latter is imaginary, but that shouldn't stop us from using it, should it?)
Consider $(-2)^2=4=2^2$. If one could devise a definition of the square root function such that $\sqrt{x^2}=x$ for any $x$, what would be the value of $$ \sqrt{4}=\sqrt{(-2)^2}=\sqrt{2^2} $$ without getting a contradiction?
This shows that it is not possible to define a function with the desired property, so we abandon the idea and define, for $x\ge0$,
In particular, $\sqrt{x^2}=|x|$, because $|x|\ge0$ by definition and $|x|^2=x^2$.
As an aside, note that $\sqrt{x^3}$ makes sense only if $x\ge0$, so in this case $\sqrt{x^3}=x\sqrt{x}$ is correct. You could also say $$ \sqrt{x^3}=\sqrt{x^2\cdot x}=\sqrt{x^2}\cdot \sqrt{x} =|x|\sqrt{x} $$ which would be correct too, but $|x|=x$ as $x\ge0$.
Note, instead, that if $x<0$ and $y<0$, it would be very incorrect to write $$ \sqrt{xy}=\sqrt{x}\sqrt{y} $$ but you can surely say $\sqrt{xy}=\sqrt{|x|}\sqrt{|y|}$.