Let $f(x)$ and $g(x) $be functions I've made a method to find range of $f(g(x))$
$$ f(x)= \begin{cases} 2+x,& 0\leq x<2\\ x^2,& 2\leq x<4 \end{cases} $$
$$ g(x)= \begin{cases} 1+x,& 0\leq x<1\\ 3-x,& 2\leq x<5 \end{cases} $$
Now to find the range what I did was put $g(x)$ in $f(x)$ and find intersection of function and x Like putting
2+(1+x)......0<=(1+x)<2 and 0<=x=<1
Taking the intersection I got this function will be satisfactory for 0=<x<1. Apparently the answer isnt coming sme and I'm not able to figure out what is wrong in my method . Is there any simpler method
Step 1: examine the range of $g$
Step 2: intersect the range of $g$ with the domain of $f$
Step 3: the final range is $R=f(C)=$ ?
Bonus: it is not asked but the domain of $f\circ g$ is $D=g^{-1}(C)=$ ?