**Question:**

Discuss the continuity of $f(x)=\sin |x|$.

**Solution:**

Let $f(x)=\sin |x|$

This function $f$ is defined for every real number and $f$ can be written as the composition of two functions as,

$f=hog$, where $g(x)=|x|$ and $h(x)=\sin x$

$[\because h o g(x)=h(g(x))=h(|x|)=\sin |x|]$

It has to be proved first that $g(x)=|x|$ and $h(x)=\sin x$ are continuous functions.

$g(x)=|x|$ can be written as

$g(x)= \begin{cases}-x, & \text { if } x<0 \\ x, & \text { if } x \geq 0\end{cases}$

Clearly, $g$ is defined for all real numbers.

Let $c$ be a real number.

Case I:

If $c<0$, then $g(c)=-c$ and $\lim _{x \rightarrow c} g(x)=\lim _{x \rightarrow c}(-x)=-c$

$\therefore \lim _{x \rightarrow c} g(x)=g(c)$

Therefore, $g$ is continuous at all points $x<0$

Case III:

If $c=0$, then $g(c)=g(0)=0$

$\lim _{x \rightarrow 0^{-}} g(x)=\lim _{x \rightarrow 0^{-}}(-x)=0$

$\lim _{x \rightarrow 0^{+}} g(x)=\lim _{x \rightarrow 0^{+}}(x)=0$

$\therefore \lim _{x \rightarrow 0^{-}} g(x)=\lim _{x \rightarrow 0^{+}}(x)=g(0)$

Therefore, $g$ is continuous at $x=0$

From the above three observations, it can be concluded that $g$ is continuous at all points.

Now, $h(x)=\sin x$

It is evident that $h(x)=\sin x$ is defined for every real number.

Let $c$ be a real number.

Put $x=c+k$

If $x \rightarrow c$, then $k \rightarrow 0$

$h(c)=\sin c$

$h(c)=\sin c$

$\lim _{x \rightarrow c} h(x)=\lim _{x \rightarrow c} \sin x$

$=\lim _{k \rightarrow 0} \sin (c+k)$

$=\lim _{k \rightarrow 0}[\sin c \cos k+\cos c \sin k]$

$=\lim _{k \rightarrow 0}(\sin c \cos k)+\lim _{h \rightarrow 0}(\cos c \sin k)$

$=\sin c \cos 0+\cos c \sin 0$

$=\sin c+0$

$=\sin c$

$\therefore \lim _{x \rightarrow c} h(x)=g(c)$

So, $h$ is a continuous function.

$\therefore f(x)=h o g(x)=h(g(x))=h(|x|)=\sin |x|$ is a continuous function.