Suppose $\displaystyle f(x)=\sqrt(x)$ and $\displaystyle g(x)=x^2-5$.

Note that the domain of $\displaystyle f$ is $\displaystyle x\ge 0$, the range of $\displaystyle f$ is $\displaystyle y\ge 0$, the domain of $\displaystyle g$ is all real numbers, and the range of $\displaystyle g$ is also all real numbers.

The composite function $\displaystyle (g-of-f)(x)=g(f(x))=(\sqrt{x})^2-5=x-5$. For this function the domain would be all real numbers, but if $\displaystyle f$ does not exist then you can plug it in, and $\displaystyle x\ge 0$ for $\displaystyle f$ to exist. So for this composite function the domain is $\displaystyle x\ge 0$.

The composite function $\displaystyle (f-of-g)(x)=f(g(x))=\sqrt{(x^2-5)}=\sqrt{x^2-5}$. For this function the domain would be $\displaystyle -\sqrt5\ge x\ge \sqrt5$. Since all of these numbers are in the range of $\displaystyle g$, they can be plugged in to $\displaystyle f$.

My question is, what is the domain of the composite function $\displaystyle (f-of-g)(x)=f(g(x))$? I believe that it would be $\displaystyle x\ge\sqrt5$ since you can't plug a negative into $\displaystyle f$ and you can't plug a number between $\displaystyle 0$ and $\displaystyle \sqrt5$ into the resultant composite function. Is this correct? Is there a better way to think about this that does not involve "unions" and "intersections"?