Domain is all your possible x-value that your graph includes. The only possible break in your function is that jump at x=1. Even though there's a jump at x=1, the bottom line has a solid circle, so that x=1 value is included in your function. There no break in the graph anywhere else so all other values are included in the domain, hence (-∞, ∞).
Range is all your possible y-value. Again, there's an open circle at y=2, but that circle is filled in with y=2 from the line on the right side, so y=2 is included in your function. There's no other point on the graph where the function break in the y-direction, therefore the range is (-∞, ∞).