That's fine and probably also the solution that you were intended to find.

You have to watch out for two things here:

- denominators cannot become 0 since division by zero isn't defined in R.

- expressions under square roots cannot be negative, squares are nonnegative in R.

I would like to point out though that formally, the domain should be given if you want to talk about a 'function'. Better wording would have been to find the 'maximal' domain on R, sometimes called the 'natural domain'.