You can put this solution on YOUR website! For x less than or equal to -1, the graph is a line with positive slope; that means the maximum value is at the right end of the interval -- i.e., at x = -1. The function value there is
And clearly the function value goes to negative infinity as x goes to negative infinity.
So the range for the first part of the function is (-infinity, 2].
For x greater than 0, the graph is a line with a negative slope, so the maximum value is at the left end of the interval, at x=0. The function value there is -1, which is already in the range from the first part of the function.
Since for this second part of the function the maximum value is less than the maximum function value for the first part of the function, the range of the entire function is just the range of the first part.
Answer: The range of the function is (-infinity, 2].