Ranges of $f\circ g$ and $g\circ f$ of $f(x)= e^x$ and $g(x) =x^2-x$? In my book it is given that domains and ranges of $f$ and $g $ are $\mathbb{R}^+,\mathbb{R}$ and $\mathbb{R},\mathbb{R}$ respectively. By evaluating these I got the domains of $f\circ g$ and $g\circ f$ as $(-\infty,0)\cup (1,\infty)$ and $(0,\infty)$ which are correct as per my book. 
(For $f\circ g $ I put $x$ belongs to $\mathbb{R}$  and $x^2-x$ > 0 to get this result, for $g\circ f$ I directly put domain of f since range of f is domain of g.) 
I feel that for both $f\circ g$ and $f\circ g$ ranges should be $\mathbb{R}$ but my book says they are $(1,\infty)$ and $(0,\infty)$. Why is this so?
 A: The domain of $f$ is $\mathbb{R}$; the range is $\mathbb{R}^+$ (the positive reals).
The domain of $g$ is $\mathbb{R}$; the range is $(-1/4,\infty)$, because
$$
g(x)=\left(x-\frac{1}{2}\right)^2-\frac{1}{4}
$$
When can we compute $f\circ g(x)$? For every $x$, so the domain is indeed $\mathbb{R}$. However the value of $g(x)$ is $\ge-1/4$, so $f(g(x))\ge e^{-1/4}$ and therefore the range is $[e^{-1/4},\infty)$ (because $f$ is increasing and upper unbounded).
When can we compute $g\circ f(x)$? For every $x$. However $f(x)>0$; when $x>0$ the function $g(x)$ takes on all values in its range, because the minimum is at $1/2$. So the range of $g\circ f$ is $[-1/4,\infty)$.
In the picture, $A=f\circ g$ and $B=g\circ f$.

The situation would be very different if $g(x)=\sqrt{x^2-x}$. In this case the domain of $g$ is $(-\infty,0]\cup[1,\infty)$ and the range is $[0,\infty)$.
Therefore the domain of $f\circ g$ is the same as the domain of $g$, the range is $[1,\infty)$.
For the domain of $g\circ f$ one has to solve $e^{2x}-e^x\ge0$, so $x\ge0$. The range of $g\circ f$ is so $[0,\infty)$, because over $[0,\infty)$, the function $f$ takes on all values in $[1,\infty)$.
