Domain of Composite Root Function

Suppose we assume domain is defined as all the input values for which a *real* output is defined.

So, for $\displaystyle g(x)=\sqrt{x}$ the domain is $\displaystyle x\ge0$ since any negative number will result in an imaginary output. The range of $\displaystyle g(x)$ is also all non-negative numbers.

But suppose $\displaystyle f(x)=x^2$. The composite function $\displaystyle (f \circ g)(x)$ would look like this: $\displaystyle (f \circ g)(x)={\sqrt{x}}^2$. For this function, $\displaystyle -1$ could be considered a valid input value since $\displaystyle \sqrt{-1}^2 = i^2 = -1$, which is a real number.

So the question is: is $\displaystyle -1$ in the domain of $\displaystyle (f \circ g)(x)$? Or would it be considered an invalid input since you're plugging the output of $\displaystyle g(x)$ into $\displaystyle f(x)$, and $\displaystyle g(x)$ doesn't have any output for $\displaystyle x=-1$? Is this even a valid question - seems to me if you're considering $\displaystyle i$ then maybe the whole definition of domain needs to be changed to account for it. Is this done?

I quickly searched the Math Help Forum for help with this question. The only relevant post I found was Composition of Function, but that made things even more unclear. Biffboy uses this example to demonstrate how the domain of the composite function does *not* have to be limited to the range of the 'input' function. But then he does exactly that. His example is even cited by Sylvia104 as a good one showing how the domain doesn't have to be so limited.

Re: Domain of Composite Root Function

Some thoughts, does $\displaystyle (f \circ g)(x) = (g \circ f)(x)$ in this example?

Also consider the definition $\displaystyle \sqrt{x^2} = |x|$

Re: Domain of Composite Root Function

I don't believe $\displaystyle (f \circ g)(x)$ and $\displaystyle (g \circ f)(x)$ would be considered equal.

Looking at $\displaystyle (g \circ f)(x)$ it is clear the domain of the composite function is not limited to the range of the 'input' fuction. Here $\displaystyle -1$ is more clearly in the domain of the composite function since $\displaystyle \sqrt{(-1)^2}=\sqrt{1}=1$ and $\displaystyle i$ never enters the picture: the output of the 'input' function is real.

So it seems to me there is a different issue going on with $\displaystyle (f \circ g)(x)$, where the output of the 'input' function is imaginary.