It is true that you cannot take the square root of a negative number, but the negative sign in the function is outside the radical, not inside. So that negative sign only affects the output of the function. The domain is the set of all possible values of the input x.