Phillip D. answered 11/19/19
AMC & AIME Expert | AP & SAT Tutor | 8+ Yrs | Python & STEM Support
1st step determine domain, since it’s a piecewise function let’s look at the two parts. Domain is about what values can x take on. (The two cases to consider in domain analysis are when x is under a radical sign and when x is part of the denominator, we see none of these two conditions apply so we know all values of x can work).
x > 0, we have the function f(x) = -x - 2
x <= 0, we have f(x) = -x
we look at these parts and see all values of x produce a valid y so the domain is all real numbers.
2nd step is determining the range. Range is about what values of y or the function f(x) can be produced from x. We see with the function that we can not produce the values from -2 to 0 with our function. So our range is all real numbers except the interval (-2,0] (0 is inclusive because of the x = 0, gives f(x) = 0; whereas -2 is exclusive because we can't evaluate -x - 2 at x = 0 due to the inequality).
Below is the graph:
https://drive.google.com/file/d/1lbr2BWAL30CHkVZD5Q2KhBlDB9QLe441/view?usp=sharing