Q) Consider the following functions
$f(x) = \left\{\begin{matrix} 1, & |x| \leq 1 \\ 0, & |x| > 1 \end{matrix}\right.$ and $g(x) = \left\{\begin{matrix} 1, & |x| \leq 2 \\ 2, & |x| > 2 \end{matrix}\right.$
Define $h_{1}(x) = f(g(x))$ and $h_{2}(x) = g(f(x))$. Which of the following statements is correct ?
(A) $h_1$ and $h_2$ are continuous everywhere
(B) $h_1$ is continuous everywhere and $h_2$ has discontinuity at $\pm 1$
(C) $h_2$ is continuous everywhere and $h_1$ has discontinuity at $\pm2$
(D) $h_1$ has discontinuity at $\pm2$ and $h_2$ has discontinuity at $\pm1$
My Attempt :-
I can rewrite $f(x)$ and $g(x)$ as :-
$f(x) = \left\{\begin{matrix} 1, & 0 \leq x \leq 1 \;\cup\; -1 \leq x < 0 \\ 0, & x > 1\; \cup\; x <-1 \end{matrix}\right.$
$g(x) = \left\{\begin{matrix} 1, & 0 \leq x \leq 2 \;\cup\; -2 \leq x < 0 \\ 2, & x > 2\; \cup\; x <-2 \end{matrix}\right.$
Here, $f$ has jump discontinuity at $ \pm 1$ and $g$ has jump discontinuity at $ \pm 2$.
Now, For $h_1=f(g(x)),$
$f(-1 \leq g(x) \leq 1) =1 $ when $-2 \leq x \leq 2 $
and $f(g(x) >1 \; \cup\; g(x) < -1) =0 $ when $x>2 \; \cup \; x < -2 $
So, $h_1=f(g(x))$ has discontinuity at $ \pm 2$
Now, For $h_2=g(f(x)),$
$g(-2 \leq f(x) \leq 2) =1$ when $-\infty < x< \infty$
So, $h_2=g(f(x))$ is continuous everywhere.
So, I am getting answer as $(C).$ Please verify whether it is correct or not.
Yes, answer $(C)$ is correct !