This was a bonus question on a test I just took:
Write a function with a domain of all real numbers and a range of only $2$ numbers.
The closest I got to an answer was $f(x)=\frac{x}{|x|}$, which has a range of $\{-1,1\}$, but it fails the part about the domain, because 0 has to be excluded.
Any ideas for the solution to this? Is a solution even possible?