Domain: All real numbers.
R: (∞, -2] U (-1, ∞)
How to find the domain and range?
For a function f(x) = y, the domain is the set of possible inputs (possible values of x) and the range is the set of possible outputs (possible values of y).
Here we have the piecewise fuction.
f(x) = x - 2 if x ≤ 0
f(x) = 2x - 1 if x > 0
First, we can see that it covers all the possible values of x, so the domain is all real numbers.
For the range we have two lines, it would tipically cover all the real numbers. But let's look at what happens when x =0.
The first function:
f(0) = 0 - 2 = -2
For the other function:
f(0) = 2*0 - 1 = -1
So we have a jump from -2 to -1, (notice that -2 belongs to the range and -1 does not) then the range is:
R: (∞, -2] U (-1, ∞)