How to find the range or domain of a function? This is a general question I'm asking, I really need it explained. Here's an example of what I mean:
The functions $f$ and $g$ are defined by
$f( x)= x^3 + 1$,     $0 ≤ x ≤ 3$
$g(x)= x + 5$,         $x \in \mathbb R$.
And I was asked to find the range of $g(f(x))$??
Which I got to be  $= x^3 + 6$.
But idk how to find the range and if  I was asked to state the domain in another case I wouldn't know how to.
 A: You can find the range of composition of two functions by following the composition step by step. Generally, the range consists of all numbers that the function can produce, given $x$ within a specified interval. First, you find what numbers can be produced by $f$ when given $x$ in $[0,3]$. Then you are to feed the output of $f$ into $g$ and see what $g$ outputs. 
It helps to pay attention to the intervals where each function is increasing or decreasing. As a matter of fact, $x^3+1$ is increasing for all $x\ge 0$. Thus, its range on the interval $[0,3]$ is the interval $[f(0),f(3)]$. Which is $[1,28]$. 
Next step is to find the range of  $g$ on the interval $[1,28]$. Again, it helps that $g$ is increasing. For this reason, the range is $[g(1),g(28)]$. Which is $[6,33]$. This is the range of the composite function as well. 
A: Define $h : \mathbb{R} \rightarrow \mathbb{R}$ as follows: $$h(x) = x^3+6.$$
The important thing is that we've chosen $h$ in such a way that the range of $g \circ f$ just simply equals $h([0,3]).$ So lets go ahead and find $h([0,3])$.
To get started, we need to know the following:

Theorem. Suppose $f : \mathbb{R} \rightarrow \mathbb{R}$ is a continuous function. Then $$f([a,b]) = \left[\mathop{\mathrm{min}}_{x \in [a,b]} f(x), \mathop{\mathrm{max}}_{x \in [a,b]} f(x)\right]$$

Therefore, since $h$ is continuous, we have: $$h([0,3]) = \left[\mathop{\mathrm{min}}_{x \in [0,3]} h(x), \mathop{\mathrm{max}}_{x \in [0,3]} h(x)\right]$$
Now lets use:

Theorem. Suppose $f : \mathbb{R} \rightarrow \mathbb{R}$ is a function that preserves order on the interval $[a,b]$. Then it has a minimum and a maximum on this interval, and $$\mathop{\mathrm{min}}_{x \in [a,b]} f(x) = f(a), \qquad \mathop{\mathrm{max}}_{x \in [a,b]} f(x) = f(b)$$

Therefore, since $h$ preserves order, we have: $$h([0,3]) = [h(0), h(3)]= [6,33]$$
So the range of $g \circ f$ is $[6,33]$.
