Check the picture below.
let's recall that the Domain is the extent to where the graph reaches horizontally, in this case it never left -5, so is neither less than or greater than -5, is simply just that one number because it never really changed.
For the Range, you're correct, kinda, it'd be -2 and 6 for the extent it goes vertically, however, let's notice the endpoints for the graph, it has a circle, or namely a "hole" at the end, a hole means it goes up but it doesn't include the end value, so, if we use -2 ⩽ y ⩽ 6, that means it includes -2 and 6, but it doesn't because of the holes, if the graph had solid circles like ●, then that means graph wise, that the endpoints are included.