The function \( f(x) \) is given by:
\[ f(x) = \begin{cases} x \sin \left( \frac{1}{x} \right), & \text{for } x \neq 0 \\ 0, & \text{for } x = 0 \end{cases} \]The given function is:
\[ f(x) = \begin{cases} x \sin \left( \frac{1}{x} \right), & \text{for } x \neq 0 \\ 0, & \text{for } x = 0 \end{cases} \]Step 1: Checking continuity at \( x = 0 \).
For \( f(x) \) to be continuous at \( x = 0 \), we need to check if:
\[ \lim_{x \to 0} f(x) = f(0) = 0. \]For \( x \neq 0 \), we have:
\[ \lim_{x \to 0} x \sin \left( \frac{1}{x} \right). \]Since \( \sin \left( \frac{1}{x} \right) \) is bounded between -1 and 1, we get:
\[ - x \leq x \sin \left( \frac{1}{x} \right) \leq x. \]As \( x \to 0 \), both bounds approach 0. By the squeeze theorem, we conclude:
\[ \lim_{x \to 0} f(x) = 0 = f(0), \]so the function is continuous at \( x = 0 \).
Step 2: Checking differentiability at \( x = 0 \).
The function \( f(x) \) is differentiable at \( x = 0 \) if:
\[ \lim_{x \to 0} \frac{f(x) - f(0)}{x - 0} = \lim_{x \to 0} \frac{x \sin \left( \frac{1}{x} \right)}{x}. \]This simplifies to:
\[ \lim_{x \to 0} \sin \left( \frac{1}{x} \right). \]Since \( \sin \left( \frac{1}{x} \right) \) oscillates infinitely as \( x \to 0 \), the limit does not exist. Therefore, the function is not differentiable at \( x = 0 \).