$\displaystyle \text{Question 1: Find } fog \text{ and } gof, \text{ if }:$

$\displaystyle \text{(i) } f(x) = e^x, \ \ g(x) = \log_e x$

$\displaystyle \text{(ii) }f(x) = x^2, \ \ g(x) = \cos x$

$\displaystyle \text{(iii) }f(x) =|x| , \ \ g(x) = \sin x$

$\displaystyle \text{(iv) } f(x) = x+1 , \ \ g(x) = e^x$

$\displaystyle \text{(v) }f(x) =\sin^{-1} x , \ \ g(x) = x^2$

$\displaystyle \text{(vi) } f(x) = x+1, \ \ g(x) = \sin x$

$\displaystyle \text{(vii) } f(x) = x+1, \ \ g(x) = 2x+3$

$\displaystyle \text{(viii) }f(x) =c, c\in R , \ \ g(x) = \sin x^2$

$\displaystyle \text{(ix) } f(x) =x^2 + 2 , \ \ g(x) = 1 - \frac{1}{1-x}$

$\displaystyle \text{(i) } f(x) = e^x, \ \ g(x) = \log_e x$

$\text{Let } f: R \rightarrow (0, \infty); \text{ and } g: (0, \infty) \rightarrow R$

$\text{Let us calculate } fog,$

$\text{Clearly, the range of } g \text{ is a subset of the domain of } f.$

$fog: (0, \infty) \rightarrow R$

$(fog)(x) = f(g(x)) = f(\log_e x) = \log_e e^x = x$

$\text{Let us calculate } gof,$

$\text{Clearly, the range of } f \text{ is a subset of the domain of } g.$

$\Rightarrow fog: R \rightarrow R \\ \\ (gof)(x) = g(f(x)) = g(e^x) = \log_e e^x = x$

$\\$

$\displaystyle \text{(ii) }f(x) = x^2, \ \ g(x) = \cos x$

$f: R \rightarrow [0, \infty); g: R \rightarrow [-1, 1]$

Let us calculate $fog$,

Clearly, the range of $g$ is not a subset of the domain of $f.$

$\Rightarrow \text{Domain } (fog) = \{x: x \in \text{ domain of } g \text{ and } g (x) \in \text{ domain of } f\}$

$\Rightarrow \text{Domain } (fog) = \{x: x \in R \text{ and } \cos x \in R\}$

$\Rightarrow \text{Domain of } (fog) = R$

$(fog): R \rightarrow R$

$(fog)(x) = f(g(x)) = f(\cos x) = \cos^2 x$

Let us calculate $gof,$

Clearly, the range of $f$ is a subset of the domain of $g$

$\Rightarrow fog: R \rightarrow R$

$(gof)(x) = g(f(x)) = g(x^2) = \cos x^2$

$\\$

$\displaystyle \text{(iii) }f(x) =|x| , \ \ g(x) = \sin x$

$f: R \rightarrow (0, \infty) ; g : R \rightarrow [-1, 1]$

Let us calculate $fog,$

Clearly, the range of $g$ is a subset of the domain of $f.$

$\Rightarrow fog: R \rightarrow R$

$(fog)(x) = f(g(x)) = f(\sin x) = |\sin x|$

Let us calculate $gof,$

Clearly, the range of $f$ is a subset of the domain of $g.$

$\Rightarrow fog : R \rightarrow R$

$(gof)(x) = g(f(x)) = g(|x|) = \sin |x|$

$\\$

$\displaystyle \text{(iv) } f(x) = x+1 , \ \ g(x) = e^x$

$f: R \rightarrow R ; g: R \rightarrow [ 1, \infty)$

Let us calculate $fog:$

Clearly, range of $g$ is a subset of domain of $f.$

$\Rightarrow fog: R \rightarrow R$

$(fog)(x) = f(g(x)) = f(e^x) = e^x + 1$

Let us compute $gof,$

Clearly, range of $f$ is a subset of domain of $g.$

$\Rightarrow fog: R \rightarrow R$

$(gof)(x) = g(f(x)) = g(x + 1) = e^x+1$

$\\$

$\displaystyle \text{(v) }f(x) =\sin^{-1} x , \ \ g(x) = x^2$

$\displaystyle f: [-1,1] \rightarrow \Big[ \frac{-\pi}{2}, \frac{\pi}{2} \Big] ; \ g : R \rightarrow [0, \infty)$

Let us compute the $fog:$

Clearly, the range of $g$ is not a subset of the domain of $f.$

$\text{Domain } (fog) = \{x: x \in \text{ domain of } g \text{ and } g (x) \in \text{ domain of } f\}$

$\text{Domain } (fog) = \{x: x \in R \text{ and } x^2 \in [-1, 1]\}$

$\text{Domain } (fog) = \{x: x \in R \text{ and } x \in [-1, 1]\}$

$\text{Domain of } (fog) = [-1, 1] fog: [-1,1] \rightarrow R$

$(fog)(x) = f(g(x)) = f(x^2) = \sin-1(x^2)$

Let us compute the $gof:$

$\text{Clearly, the range of } f \text{ is a subset of the domain of } g. \\ \\ fog: [-1, 1] \rightarrow R$

$(gof)(x) = g(f(x)) = g(\sin^{-1} x) = (\sin^{-1} x)^2$

$\\$

$\displaystyle \text{(vi) } f(x) = x+1, \ \ g(x) = \sin x$

$f: R \rightarrow R; g: R \rightarrow [-1, 1]$

Let us compute the $fog$

Set of the domain of $f.$

$\Rightarrow fog: R \rightarrow R$

$(fog)(x) = f(g(x)) = f(\sin x) = \sin x + 1$

Let us compute the $gof,$

Clearly, the range of $f$ is a subset of the domain of $g.$

$\Rightarrow fog: R \rightarrow R$

$(gof)(x) = g(f(x)) = g(x + 1) = \sin(x + 1)$

$\\$

$\displaystyle \text{(vii) } f(x) = x+1, \ \ g(x) = 2x+3$

$f: R \rightarrow R; g: R \rightarrow R$

Let us compute the $fog$

Clearly, the range of $g$ is a subset of the domain of $f.$

$\Rightarrow fog: R\rightarrow R$

$(fog)(x) = f(g(x)) = f(2x + 3) = 2x + 3 + 1 = 2x + 4$

Let us compute $gof$

Clearly, the range of $f$ is a subset of the domain of $g.$

$\Rightarrow fog: R \rightarrow R$

$(gof)(x) = g(f(x)) = g(x + 1) = 2(x + 1) + 3 = 2x + 5$

$\\$

$\displaystyle \text{(viii) }f(x) =c, c\in R , \ \ g(x) = \sin x^2$

$f: R \rightarrow {c}; g: R \rightarrow [0, 1]$

Let us compute the $fog$

Clearly, the range of $g$ is a subset of the domain of $f.$

$fog: R \rightarrow R$

$(fog)(x) = f(g(x)) = f(\sin x^2) = c$

Let us compute the $gof,$

Clearly, the range of $f$ is a subset of the domain of $g.$

$\Rightarrow fog: R \rightarrow R$

$(gof)(x) = g(f(x)) = g(c) = \sin c^2$

$\\$

$\displaystyle \text{(ix) } f(x) =x^2 + 2 , \ \ g(x) = 1 - \frac{1}{1-x}$

$f: R \rightarrow [2, \infty )$

$\text{For domain of } g: 1 - x \neq 0 \ \Rightarrow x \neq 1 \\ \\ \Rightarrow \text{ Domain of } g = R - {1}$

$\displaystyle g(x) = 1 - \frac{1}{1 - x} = \frac{1 - x - 1}{1 - x} = \frac{-x}{1 - x}$

For range of $g$

$\displaystyle y = \frac{-x}{1 - x} \\ \\ \Rightarrow y - xy = - x \Rightarrow y = xy - x \Rightarrow y = x(y - 1) \Rightarrow x = \frac{y}{y - 1}$

$\text{Range of } g = R - {1}$

$\text{Therefore, } g: R - {1} \rightarrow R - {1}$

Let us compute the $fog$

Clearly, the range of $g$ is a subset of the domain of $f.$

$\Rightarrow fog: R - {1} \rightarrow R$

$\displaystyle (fog)(x) = f(g(x)) \\ \\ = f \Big(\frac{-x}{x - 1} \Big) = \Big(\frac{-x}{x - 1}\Big)^2 + 2 = \frac{x^2 + 2x^2 + 2 - 4x}{(1 - x)^2} = \frac{3x^2 - 4x + 2}{(1 - x)^2}$

Now we have to compute $gof$

Clearly, the range of $f$ is a subset of the domain of $g.$

$\Rightarrow gof: R \rightarrow R$

$\displaystyle (gof)(x) = g(f(x)) = g(x^2 + 2) = 1 - \frac{1}{1 - (x^2 + 2)} = \frac{x^2 + 2}{x^2 + 1}$

$\\$

$\displaystyle \text{Question 2: Let } f(x) = x^2 + x + 1 \text{ and } g(x) = \sin x . \text{ Show that } fog \neq gof.$

$\text{Given as } f(x) = x^2 + x + 1 \text{ and } g(x) = \sin x$

$(fog)(x) = f(g(x)) = f(\sin x) = \sin^2 x + \sin x + 1$

$(gof)(x) = g(f(x)) = g(x^2 + x + 1) = \sin(x^2+ x + 1)$

$\text{Therefore, } fog \neq gof.$

$\\$

$\displaystyle \text{Question 3: If } f(x) = |x|, \text{ prove that } fof = f.$

$\text{Given that } f(x) = |x|$

$(fof)(x) = f(f(x)) = f(|x|) = ||x|| = |x| = f(x)$

$\text{Therefore, } (fof)(x) = f(x), \ \forall \ x \in R \\ \\ \text{ Hence, } fof = f$

$\\$

Question 4: If $f(x) = 2x+5 \text{ and } g(x) = x^2 + 1$ be two real functions, then describe each of the following functions:

$(i) \ \ fog \hspace{1.0cm} (ii) \ \ gof \hspace{1.0cm} (iii) \ \ fof \hspace{1.0cm} (iv) \ \ f^2$

The function $f(x)$ and $g(x)$ are polynomials.

$\Rightarrow f: R \rightarrow R \text{ and } g: R \rightarrow R.$

$\text{Therefore, } fog: R \rightarrow R \text{ and } gof: R \rightarrow R.$

$\text{(i) } (fog)(x) = f(g(x)) = f(x^2 + 1) = 2(x^2 + 1) + 5 = 2x^2 + 2 + 5 = 2x^2 +7$

$\text{(ii) } (gof)(x) = g(f(x)) = g(2x +5) = (2x + 5)^2 + 1 = 4x^2 + 20x + 26$

$\text{(iii) } (fof)(x) = f(f(x)) = f(2x +5) = 2(2x + 5) + 5 = 4x + 10 + 5 = 4x + 15$

$\text{(iv) } f^2(x) = f(x) \times f(x) = (2x + 5) (2x + 5) = (2x + 5)^2 = 4x^2 + 20x +25$

$\\$

Question 5: If $f(x) = \sin x \text{ and } g(x) = 2x$ be two real functions, then describe $gof \text{ and } fog.$ Are these equal functions?

$\text{Given as } f(x) = \sin x \text{ and } g(x) = 2x$

$\text{We know } f: R \rightarrow [-1, 1] \text{ and } g: R \rightarrow R$

Clearly, the range of $f$ is a subset of the domain of $g.$

$gof: R \rightarrow R$

$(gof)(x) = g(f(x)) = g(\sin x) = 2 \sin x$

Clearly, the range of $g$ is a subset of the domain of $f.$

$fog: R \rightarrow R$

$\text{Therefore, } (fog)(x) = f(g(x)) = f(2x) = \sin (2x)$

$\text{Clearly, } fog \neq gof$

Hence they are not equal functions.

$\\$

Question 6: Let $f, g, h$ be real functions given by $f(x) = \sin x , g(x) = 2x \text{ and } h(x) = \cos x. \text{ Prove that } fog = go(fh).$

$\displaystyle \text{Given as} f(x) = \sin x, \ g(x) = 2x \text{ and } h(x) = \cos x$

$\displaystyle \text{We know, } f: R \rightarrow [-1, 1] \text{ and } g: R \rightarrow R$

$\displaystyle \text{Clearly, the range of } g \text{ is a subset of the domain of } f.$

$\displaystyle fog: R \rightarrow R \\ \\ (fh)(x) = f(x) h(x) = (\sin x) (\cos x) = \frac{1}{2} \sin (2x)$

$\displaystyle \text{Domain of } fh \text{ is } R.$

$\displaystyle \text{Since range of } \sin x \text{ is } \Big[-1, 1 \Big], -1 \leq \sin 2x \leq 1$

$\displaystyle \Rightarrow -\frac{1}{2} \leq \sin \frac{x}{2} \leq \frac{1}{2}$

$\displaystyle \text{The Range of } fh = \Big[-\frac{1}{2}, \frac{1}{2} \Big]$

$\displaystyle \text{Therefore, } (fh): R \rightarrow \Big[\frac{-1}{2}, \frac{1}{2} \Big]$

$\displaystyle \text{Clearly, range of } f h \text{ is a subset of } g.$

$\displaystyle \Rightarrow go(fh): R \rightarrow R$

$\displaystyle \Rightarrow \text{Domains of } fog \text{ and } go (fh) \text{ are the same. }$

$\displaystyle (fog)(x) = f(g(x)) = f(2x) = \sin (2x)$

$\displaystyle (go(fh))(x) = g((f h)(x)) = g(\sin x \cos x) = 2\sin x \cos x = \sin (2x)$

$\displaystyle \Rightarrow (fog)(x) = (go(f h))(x), \ \forall \ x \in R$

$\displaystyle \text{Hence, } fog = go(fh)$

$\\$

Question 7: Let $f$ be any real function and let $g$ be a function given by $g(x) = 2x.$ Prove that $gof = f + f.$

$\text{Given, } f:R \rightarrow R$

$\text{Since } g(x) = 2x \text{ is a polynomial, } g : R \rightarrow R$

$\text{So, domains of } gof \text{ and } f+f \text{ are the same }$

$(gof)(x) = g(f(x)) = 2f(x)$

$(f+f) (x) = f(x) + f(x) = 2 f(x)$

$\Rightarrow (gof) (x) = ( f+ f) (x ) \ \forall \ x \in R$

$\text{Hence, } gof = f + f$

$\\$

$\text{Question 8: If } f(x) = \sqrt{1-x} \text{ and } g(x) = \log_e x \\ \\ \text{ are two real functions, then describe functions } fog \text{ and } gof.$

$f(x) = \sqrt{1-x}$

$\text{For domain } 1 - x \geq 0$

$\Rightarrow x \leq 1$

$\Rightarrow \text{ domain of } f = ( -\infty, 1 ]$

$\Rightarrow f : ( - \infty , 1 ] \rightarrow ( 0, \infty)$

$g(x) = \log_e x$

$\text{Clearly, } g : ( 0, \infty) \rightarrow R$

Computation of $fog:$

Clearly, the range of $g$ is not a subset of the domain of $f.$

$\Rightarrow \text{Domain } (fog) = \{ x: x \in \text{ Domain } (g) \text{ and } g(x) \in \text{ Domain of } f \}$

$\Rightarrow \text{Domain } (fog) = \{ x: x \in (0, \infty) \text{ and } \log_e x \in ( -\infty, 1 ] \}$

$\Rightarrow \text{Domain } (fog) = \{ x: x \in (0, \infty) \text{ and } x \in (0, e] \}$

$\Rightarrow \text{Domain } (fog) = \{ x: x \in (0, e] \}$

$\Rightarrow \text{Domain } (fog) = (0, e]$

$\Rightarrow fog : (0, e) \rightarrow R$

$(fog)(x) = f(g(x)) = f ( \log_e x) = \sqrt{1 - \log_e x}$

Computation of $gof:$

Clearly, the range of $f$ is a subset of the domain of $g.$

$\Rightarrow gof : (-\infty, 1] \rightarrow R$

$\displaystyle \Rightarrow (gof)(x) = g(f(x)) \\ \\ = g(\sqrt{1-x}) = \log_e \sqrt{1-x} = \log_e (1-x)^{\frac{1}{2}} = \frac{1}{2} \log_e (1-x)$

$\\$

$\displaystyle \text{Question 9: If } f : \Big( \frac{-\pi}{2}, \frac{\pi}{2} \Big) \rightarrow R \text{ and } g : [-1, 1 ]\rightarrow R \text{ be defined as } \\ \\ f(x) = \tan x \text{ and } g(x) = \sqrt{1-x^2} \text{ respectively. Describe } fog \text{ and } gof.$

$g(x) = \sqrt{1-x^2}$

$\Rightarrow x^2 \geq 0, \ \forall \ x \in [-1, 1]$

$\Rightarrow -x^2 \leq 0, \ \forall \ x \in [-1, 1]$

$\Rightarrow 1-x^2 \leq 1, \ \forall \ x \in [-1, 1]$

We know that $1 - x^2 \geq 0$

$\Rightarrow 0 \leq 1-x^2 \leq 1$

$\Rightarrow \text{Range of } g(x) = [0, 1]$

$\displaystyle \text{So, } f: \Big( \frac{\pi}{2}, \frac{\pi}{2} \Big) \rightarrow R \text{ and } g : [-1, 1] \rightarrow [0, 1]$

Computation of $fog:$

Clearly, the range of $g$ is a subset of the domain of $f.$

$\text{So, } fog : [-1, 1 ] \rightarrow R$

$(fog) (x) = f(g(x)) = f( \sqrt{1-x^2}) = \tan \sqrt{1-x^2}$

Computation of $gof:$

Clearly, the range of $f$ is not a subset of the domain of $g.$

$\displaystyle \Rightarrow \text{Domain } (gof) = \Big\{ x \in \text{ domain of } f \text{ and } f(x) \in \text{ domain of } g \Big\}$

$\displaystyle \Rightarrow \text{Domain } (gof) = \Big\{ x \in \Big( \frac{-\pi}{2}, \frac{\pi}{2} \Big) \text{ and } \tan x \in [-1, 1] \Big) \Big\}$

$\displaystyle \Rightarrow \text{Domain } (gof) = \Big\{ x \in \Big( \frac{-\pi}{2}, \frac{\pi}{2} \Big) \text{ and } x \in \Big( \frac{-\pi}{4}, \frac{\pi}{4} \Big) \Big\}$

$\displaystyle \Rightarrow \text{Domain } (gof) = \Big\{ x \in \Big( \frac{-\pi}{4}, \frac{\pi}{4} \Big) \Big\}$

$\text{So, } (gof)(x) = g(f(x)) = g( \tan x) = \sqrt{1-x^2}$

$\\$

$\displaystyle \text{Question 10: If } f(x) = \sqrt{x+3} \text{ and } g(x) = x^2 + 1 \text{ be two real functions, } \\ \\ \text{ then find } fog \text{ and } gof.$

$f(x) = \sqrt{x+3}$

$\text{For Domain } x + 3 \geq 0$

$\Rightarrow x \geq -3$

$\text{Domain of } f = [-3, \infty )$

$\text{Since } f \text{ is a square root function, range of } f = [0, \infty )$

$f: [-3, \infty) \rightarrow [0, \infty)$

$g(x) = x^2 + 1 \text{ is a polynomial }$

$\Rightarrow g: R \rightarrow R$

Computation of $fog:$

Range of g is not a subset of the domain of f

$\text{Domain } (fog) = \{ x : x \in \text{ domain of } g \text{ and } g(x) \in \text{ domain of } f(x) \}$

$\Rightarrow \text{Domain } (fog) = \{ x : x \in R \text{ and } x^2 + 1 \in [-3, \infty ) \}$

$\Rightarrow \text{Domain } (fog) = \{ x : x \in R \text{ and } x^2 + 1 \geq -3 \}$

$\Rightarrow \text{Domain } (fog) = \{ x : x \in R \text{ and } x^2 + 4 \geq 0 \}$

$\Rightarrow \text{Domain } (fog) = \{ x : x \in R \text{ and } x \in R \}$

$\Rightarrow \text{Domain } (fog) = R$

$(fog)(x) = f(g(x)) = f( x^2 +1) = \sqrt{x^2+1+3} = \sqrt{x^2+4}$

Computation of $gof:$

Range of f is a subset of the domain of $g.$

$gof: [-3, \infty) \rightarrow R$

$(gof)(x) = g(f(x)) = (\sqrt{x+3})^2 + 1 = x+ 3 + 1 = x+ 4$

$\\$

Question 11: Let $f$ be a real function given by $f(x) = \sqrt{x-2}.$ Find each of the following:

$(i) \ \ fof \hspace{1.0cm} (ii) \ \ fofof \hspace{1.0cm} (iii) \ \ ( fofof)(38) \hspace{1.0cm} (iv) \ \ f^2$

Also, show that $fof \neq f^2$

$f(x) = \sqrt{x-2}$

$\text{For Domain } x - 2 \geq 0 \Rightarrow x \geq 2$

$\text{Domain of } f = [2, \infty )$

$\text{Since } f \text{ is a square root function, range of } f = ( 0, \infty)$

$\text{So, } f: [2, \infty) \rightarrow (0, \infty)$

$\text{(i) } fof$

Range of f is not a subset of the domain of f.

$\Rightarrow \text{Domain } (fof) = \{ x : x \in \text{ domain of } f \text{ and } f(x) \in \text{ domain of } f \}$

$\Rightarrow \text{Domain } (fof) = \{ x : x \in [2, \infty) \text{ and } \sqrt{x-2} \in [2, \infty) \}$

$\Rightarrow \text{Domain } (fof) = \{ x : x \in [2, \infty) \text{ and } \sqrt{x-2} \geq 2 \}$

$\Rightarrow \text{Domain } (fof) = \{ x : x \in [2, \infty) \text{ and } x-2 \geq 4 \}$

$\Rightarrow \text{Domain } (fof) = \{ x : x \in [2, \infty) \text{ and } x \geq 6 \}$

$\Rightarrow \text{Domain } (fof) = \{ x : x \geq 6 \}$

$\Rightarrow \text{Domain } (fof) = [6, \infty)$

$fof: [6, \infty) \rightarrow R$

$(fof)(x) = f(f(x)) = f(\sqrt{x-2}) = \sqrt{ \sqrt{x-2} -2 }$

$\\$

$\text{(ii) } fofof = (fof)of$

$\text{We have, } f: [2, \infty) \rightarrow (0, \infty) \text{ and } fof : [6, \infty) \rightarrow R$

Range of f is not a subset of the domain of fof.

$\Rightarrow \text{Domain } ((fof)of) = \{ x : x \in \text{ domain of } f \text{ and } f(x) \in \text{ domain of } f of \}$

$\Rightarrow \text{Domain } ((fof)of) = \{ x : x \in [2, \infty) \text{ and } \sqrt{x-2} \in [6, \infty) \}$

$\Rightarrow \text{Domain } ((fof)of) = \{ x : x \in [2, \infty) \text{ and } \sqrt{x-2} \geq 6 \}$

$\Rightarrow \text{Domain } ((fof)of) = \{ x : x \in [2, \infty) \text{ and } x-2 \geq 36 \}$

$\Rightarrow \text{Domain } ((fof)of) = \{ x : x \in [2, \infty) \text{ and } x \geq 38 \}$

$\Rightarrow \text{Domain } ((fof)of) = \{ x : x \geq 38 \}$

$\Rightarrow \text{Domain } ((fof)of) = [38, \infty)$

$fof: [38, \infty) \rightarrow R$

$((fof)of)(x) = (fof)(f(x)) = (fof)(\sqrt{x-2}) = \sqrt{\sqrt{\sqrt{x-2}-2}-2}$

$\text{(iii) We have } (fofof)(x) = \sqrt{\sqrt{\sqrt{x-2}-2}-2}$

$\therefore (fofof)(38) = \sqrt{\sqrt{\sqrt{38-2}-2}-2} = \sqrt{ \sqrt{6-2} -2 } = \sqrt{2-2} = 0$

$\text{(iv) We have } fof = \sqrt{ \sqrt{x-2} -2 }$

$f^2(x) = f(x) \times f(x) = \sqrt{x-2} \times \sqrt{x-2} = x-2$

$\text{Therefore } fof \neq f^2$

$\\$

$\displaystyle \text{Question 12: } f(x) = \Bigg\{ \begin{array}{ll} 1+x, & 0 \leq x \leq 2 \\ 3-x, & 2 < x \leq 3 \end{array} . \ \ \ \text{ Find } fof.$

$f(x) = \Bigg\{ \begin{array}{ll} 1+x, & 0 \leq x \leq 2 \\ 3-x, & 2 < x \leq 3 \end{array}$

This can be written as

$f(x) = \Bigg\{ \begin{array}{ll} 1+x, & 0 \leq x \leq 1 \\ 1+x, & 1 < x \leq 2 \\ 3-x & 2 < x \leq 3 \end{array}$

$\text{When } 0 \leq x \leq 1$

$\text{Then, } f(x) = 1 + x$

$\text{Now when } , 0 \leq x \leq 1 \text{ then, } 1 \leq x+1 \leq 2$

$\text{Then, } f(f(x)) = 1 + ( 1 + x ) = 2 + x \ \ \ [ \because 1 \leq f(x) < 2 ]$

$\text{When, } 1 < x \leq 2$

$\text{Then, } f(x) = 1 + x$

$\text{Now when, } 1 < x \leq 2 \text{ then } 2 < x +1 \leq 3$

$\text{Then } f(f(x)) = 3 - ( 1 + x) = 2 - x \ \ \ [ \because 2 \leq f(x) < 3 ]$

$\text{When, } 2 < x \leq 3$

$\text{Then, } f(x) = 3- x$

$\text{Now when, } 2 < x \leq 3 \text{ then } 0 \leq 3-x < 1$

$\text{Then, } f(f(x)) = 1 + (3-x) = 4 - x \ \ \ [ \because 0 \leq f(x) < 1 ]$

$f(f(x)) = \Bigg\{ \begin{array}{ll} 2+x, & 0 \leq x \leq 1 \\ 2-x, & 1 < x \leq 2 \\ 4-x & 2 < x \leq 3 \end{array}$

$\\$

$\displaystyle \text{Question 13: If } f, g : R \rightarrow R \text{ be two functions defined as } f(x) = |x| + x \\ \\ \text{ and } g(x) = |x| - x \text{ for all } x \in R. \text{ Then, find } fog \text{ and } gof. \text{ Hence, find } \\ \\ fog(-3) , fog(5) \text{ and } gof(-2).$

$\text{Given } f(x) = |x| + x$

$\text{and } g(x) = |x| - x \ \forall \ x \in R$

$fog = f(g(x)) = |g(x) | + g(x) = ||x|-x|+(|x|-x)$

Therefore,

$f(g(x)) = \Bigg\{ \begin{array}{ll} 0, & x \geq 0 \\ \\ 4x & x < 0 \end{array}$

$f(g(x)) = \Bigg\{ \begin{array}{ll} 4x, & x > 0 \\ \\ 0 & x \geq 0 \end{array}$

$gof = g(f(x)) = |f(x)|-f(x) = ||x|+x| - ( |x|+x)$

$g(f(x)) = \Bigg\{ \begin{array}{ll} 0, & x \geq 0 \\ \\ 0 & x < 0 \end{array}$

Therefore, g(f(x)) = gof = 0

$\text{Now, } fog(-3) = 4 ( -3) = - 12 \hspace{1.0cm} ( \text{ since } fog = 4x \text{ for } x < 0 )$

$fog(5) = 0 \hspace{1.0cm} ( \text{ since } fog = 0 \text{ for } x \geq 0 )$

$gof(-2) = 0 \hspace{1.0cm} ( \text{ since } gof = 0 \text{ for } x < 0 )$