Set of solutions to $\sqrt{x^2}=-x$ The question is:

The set of all real numbers x such that $$\sqrt{x^2}=-x$$ consists of: A: zero only
B: nonpositive real numbers only
C: positive real numbers only
D: all real numbers
E: no real numbers

I chose D because the root of any number gives a $+$ and $-$, so if $x$ is a positive real number eg. $2$ then $\sqrt{4^2}= -2$
and if $x$ is a negative real number eg. $-2$ then $\sqrt{4^2} = 2$
But the answer is B, can someone explain this to me? I'm presuming that in maths when they have an equation with $\sqrt{\cdot}$ they mean $+$ unless there is a $-$ or plus/minus sign. Can someone confirm this?
A: The square root of a nonnegative real number $x$ is, by definition, the positive real number $a$ such that $a^2 = x$. As a consequence, you have the property
$$\sqrt{x^2} = |x|$$
which reduces your question to: what real numbers satisfy
$$|x| = -x$$
If you know how the absolute value works (or: check its definition), this shouldn't be hard anymore.
A: Let's use your example.
Putting $x=2$ in the given function we get $\sqrt {2^2}=-2$.
But we know that square roots always produce positive numbers.
Hence $\sqrt {2^2}$ should be equal to $2$. Therefore if $x$ is positive, then the given equation won't work.
Now, putting $x=-2$ in the given equation we get $\sqrt {(-2)^2}=-(-2)=2.$ Which is true since $\sqrt {(-2)^2}=\sqrt {2^2}=\sqrt 4=2$
So in other words, the given equation holds for all negative real numbers and Zero.
Hence B is the correct option.
