By definitions of the functions
f and
g, we have
g(x)=f(f(x))=1+f(x) for 0≤f(x)≤2
=3−f(x) for 2<f(x)≤3.
Now we find the form of g(x) as a function of x.
We consider two sub-intervals I1(0≤x≤2) and I2(2<x≤3) of the interval I(0≤x≤3).
(i) On I1, we have f(x)=1+x
Now 0≤f(x)≤2⇒0≤1+x≤2 ⇒−1≤x≤1⇒0≤x≤1 on I1.
∴g(x)=1+f(x)=1+(1+x)=2+x for 0≤x≤1.
and 2<f(x)≤3⇒2<1+x≤3
⇒1<x≤2 which belong to I1
∴g(x)=3−(1+x)=2−x,1<x≤2.
(ii) On I2,we have f(x)=3−x.
Now 0≤f(x)≤2
⇒0≤3−x≤2⇒−3≤−x≤−1⇒3≥x≥1⇒1≤x≤3.⇒2≤x≤3 on I2.
∴g(x)=1+(3−x)=4−x for 2<x≤3.
and 2<f(x)≤3⇒2<3−x≤3.
⇒−1<−x≤0⇒0≤x<1<ϵI2.
∴g(x) is not defined in this case.
Thus g is defined as follows :g(x)=2+x for 0≤x≤1
=2−x for 1<x≤2
=4−x for 2<x≤3.
We test the function g for continuity at x=1 and x=2 only.g(1)=3,g(1−0)=limh→0[2+(1−h)]=3 and g(1+0)=limh→0[2−(1+h)]=1.
Hence g is discontinuous at x=1 g(2)=2−2=0,
g(2−0)=limh→→0[2−(2−h)]=0 and g(2+0)=limh→→0[4−(2+h)]=2.
Hence g is also discontinuous at x=2.