To find g o f(x), we need to replace each x in g(x) for f(x), this is:
Its domain must contain the numbers that make the function be real. In this case the function can be indefinite when having a negative root, it means that the domain of this function is:
Do the same procedure to find f o g(x):
The domain of this function is: