Domain: All real numbers (−∞,∞)
Range: (−∞,2]
The function f(x) you've described has two different rules for different values of x:
If x is less than zero (x<0), then f(x)=x.
If x is greater than or equal to zero (x≥0), forf(x)=2.
First, let's talk about the graph:
To graph this function, you'll have two parts:
For x<0, the graph is a line that represents f(x)=x.
For x≥0, the graph is a horizontal line at f(x)=2.
Now, the domain and range:
Domain: The domain of a function is the set of all possible x values for which the function is defined. In this case, the function is defined for all real numbers. So, the domain is (−∞,∞), which means all real numbers.
Range: The range of a function is the set of all possible f(x) values that the function can output. In this case, for x<0, f(x)=x, which means the range for this part is all real numbers less than 0.
For x≥0, f(x)=2, which means the range for this part is simply the value 2. So, the overall range is from negative infinity to 2, inclusive (written as (−∞,2]).
To summarize:
Domain: All real numbers (−∞,∞)
Range: (−∞,2]