Discuss the continuity of the function
Question:

Discuss the continuity of the function $f(x)=\left\{\begin{array}{cc}\frac{x}{|x|}, & x \neq 0 \\ 0, & x=0\end{array}\right.$.

Solution:

Given: $f(x)=\left\{\begin{array}{l}\frac{x}{|x|}, x \neq 0 \\ 0, x=0\end{array}\right.$

$|x|=\left\{\begin{array}{l}x, x \geq 0 \\ -x, x<0\end{array}\right.$

$\Rightarrow f(x)=\left\{\begin{array}{c}1, x>0 \\ -1, x<0 \\ 0, x=0\end{array}\right.$

We have

$(\mathrm{LHL}$ at $x=0)=\lim _{x \rightarrow 0^{-}} f(x)=\lim _{h \rightarrow 0} f(0-h)=\lim _{h \rightarrow 0} f(-h)=\lim _{h \rightarrow 0}(-1)=-1$

$($ RHL at $x=0)=\lim _{x \rightarrow 0^{+}} f(x)=\lim _{h \rightarrow 0} f(0+h)=\lim _{h \rightarrow 0} f(h)=\lim _{h \rightarrow 0}(1)=1$

$\therefore \lim _{x \rightarrow 0^{-}} f(x) \neq \lim _{x \rightarrow 0^{+}} f(x)$

Thus, $f(x)$ is discontinuous at $x=0$.