In Mathematica, you can use the following functions:
http://reference.wolfram.com/language/ref/FunctionRange.html
http://reference.wolfram.com/language/ref/FunctionDomain.html