This can be tricky. For this problem, we have two restrictions to make. After -5, 5 we need the domain to be undefined but include the endpoints and at 2 we need F to be undefined. The way you can restrict a function from being able to extend beyond a point is by using square roots. Cross over into a negative square root and the domain is done. To remove a point, use a rational function. (1/(x-2)) - now x=2 is undefined. To make this easier at the end points though let's use 3/(x-2). So at x=-5, 5 we want F=0 so it is included in the domain. The sign will be different though at the different endpoints, but if we square the expression above, both points will be positive. . We need to subtract 1 from this though to make f=0 at x=-5,5 and this in fact works.

If you check for values beyond the endpoints of the required domain I think it checks out. This isn't easy to follow but I kind of just wrote down my inner monologue. I hope it helps.

EDIT: Oh my God. Grrrrrrrrrrrrrrrrrrr. I missed a crucial negative. [-5,-2)U(2,5] Disregard this but maybe it can help some. Sorry.