Let \(f(x)=\begin{cases}\displaystyle\frac{|x|}{x}, & x \ne 0\\ 1, & x = 0\end{cases}\) and \(g(x)=\begin{cases}x\sin\left(\displaystyle\frac{1}{x}\right), & x \ne 0\\ 0, & x = 0\end{cases}\)
Then at the origin, which one of the following is true?
Answer & explanation
Correct answer: option 2
The correct answer is Option (2) → \(g(x)\) is continuous, but \(f(x)\) is not continuous
A function is continuous at 0 when its limit at 0 exists and equals its value at 0.
For f: \(|x| = x\) when \(x \gt 0\) and \(|x| = -x\) when \(x \lt 0\), so
\( \displaystyle \lim_{x \to 0^+} \frac{|x|}{x} = \lim_{x \to 0^+} \frac{x}{x} = 1 \)
\( \displaystyle \lim_{x \to 0^-} \frac{|x|}{x} = \lim_{x \to 0^-} \frac{-x}{x} = -1 \)
The left-hand and right-hand limits differ, so \(\lim_{x \to 0} f(x)\) does not exist, and f is not continuous at 0.
For g: since \(\left|\sin\frac{1}{x}\right| \le 1\),
\( \displaystyle 0 \le \left|x\sin\frac{1}{x}\right| \le |x| \)
As \(x \to 0\), \(|x| \to 0\), so by the sandwich theorem
\( \displaystyle \lim_{x \to 0} x\sin\frac{1}{x} = 0 = g(0) \)
So g is continuous at 0.