To confirm if the domain of the function
contains or not the point x=-2, let us evaluate the function at this point, that is, we will substitute the x by -2, in the function as follows
Now let us ask: Is the result a real number? Does make sense the result?
These questions have to be answered in order to determine whether a point belongs or not to a domain of a function.
In this question in particular, the evaluation of the function is the square root of a negative number, if we remember the square root only makes sense for a positive number, that is we can only take the square root on positive numbers.
Therefore, since evaluating the function at -2, we arrive in an expression that doesn't make sense we conclude that -2 is not in the domain of f(x).