Let $f: [a,b] \rightarrow \mathbb{R}$ and $g: [c,d] \rightarrow \mathbb{R}$.
So that the composition $g\circ f$ is a function the only condition is that the image of $f$ is a subset of the domain of $g$, so $f \left( D_f \right) \subseteq D_g \Rightarrow f([a,b])\subseteq [c,d]$, or not?
Or is there also an other condition?