If we have $f(x)=\sqrt{x}$
Find $g(x)$ where $f(g(x))=-f(x) =-\sqrt{x}$
I know that the square root can have plus and minus value in the same time
but I what that $f(g(x))$ value is negative when $f(x)$ is positive and vice versa.
My calculations led me to controversial results that $g(x) = (-1)^2x$
When I plug it back to my equation I found my self confused between two different ways to solve the problem.
The first solution
$f(g(x))=f((-1)^2x)=\sqrt {(-1)^2x}=(-1)^{2*\frac 1 2} x^{\frac 1 2}=-\sqrt{x}$
Or the second confusing solution
$f(g(x))=f((-1)^2x)=\sqrt {(-1)^2x}=\sqrt {1*x}=\sqrt{x}$
Actually I wonder if there is a role control this situation and show what the priority of handling powers with bases, I mean shall I handle powers with powers first or handle powers with base first, and if the second solution is correct then $g(x)$ must be other value to have a negative result, so for that I am really confused.