f: R → R
This is known as signum function.
Let us check value of f(x) for different values of x
For x = –1
x < 0
So, f(x) = –1
For x = –2
x < 0
So, f(x) = –1
For x = 1
x > 0
So, f(x) = 1
For x = 2
x > 0
So, f(x) = 1
For x = 0
x = 0
So, f(x) = 0
Now,
Plotting graph
Here,
Domain = All values of x = R
Range = All values of y
Since y will have value 0, 1 or –1
Range = {0, 1, –1}