Prove that $f(x)=\left\{\begin{array}{ll}\frac{x-|x|}{x}, & x \neq 0 \\ 2 & , x=0\end{array}\right.$ is discontinuous at $x=0$
The given function can be rewritten as
$f(x)= \begin{cases}\frac{x-x}{x}, & \text { when } x>0 \\ \frac{x+x}{x}, & \text { when } x<0 \\ 2, & \text { when } x=0\end{cases}$
$\Rightarrow f(x)=\left\{\begin{array}{l}0, \text { when } x>0 \\ 2, \text { when } x<0 \\ 2, \text { when } x=0\end{array}\right.$
We have
(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} 2=2$
(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} 0=0$
$\therefore \lim _{x \rightarrow 0^{-}} f(x) \neq \lim _{x \rightarrow 0^{+}} f(x)$
Thus, $f(x)$ is discontinuous at $x=0$.