For functions like $f(x)=x^n g(x)$ where $g(x)$ is a bounded oscillating function near $x=0$ (like $\sin(1/x)$ or $\cos(1/x)$) and $f(0)=0$: - The function is continuous at $x=0$ if $n>0$. - The function is differentiable at $x=0$ if $n>1$.
Step 1: Check for continuity at $x=0$.
A function is continuous at $x=a$ if $\lim_{x \to a} f(x) = f(a)$. Here, we need to check if $\lim_{x \to 0} x^2 \cos(\frac{\pi}{x}) = f(0) = 0$. We use the Squeeze Theorem. We know that for any $x \neq 0$: \[ -1 \le \cos(\frac{\pi}{x}) \le 1. \] Multiplying by $x^2$ (which is non-negative): \[ -x^2 \le x^2 \cos(\frac{\pi}{x}) \le x^2. \] Since $\lim_{x \to 0} (-x^2) = 0$ and $\lim_{x \to 0} (x^2) = 0$, by the Squeeze Theorem: \[ \lim_{x \to 0} x^2 \cos(\frac{\pi}{x}) = 0. \] Since the limit equals $f(0)$, the function is continuous at $x=0$.
Step 2: Check for differentiability at $x=0$.
We use the first principle definition of the derivative: \[ f'(0) = \lim_{h \to 0} \frac{f(0+h) - f(0)}{h}. \] \[ f'(0) = \lim_{h \to 0} \frac{h^2 \cos(\frac{\pi}{h}) - 0}{h} = \lim_{h \to 0} h \cos(\frac{\pi}{h}). \]
Step 3: Evaluate the limit for the derivative.
We use the Squeeze Theorem again. \[ -1 \le \cos(\frac{\pi}{h}) \le 1. \] Multiplying by $h$: If $h>0$, $-h \le h \cos(\frac{\pi}{h}) \le h$. If $h<0$, $-h \ge h \cos(\frac{\pi}{h}) \ge h$. In either case, as $h \to 0$, the function $h \cos(\frac{\pi}{h})$ is squeezed between two functions that approach 0. \[ \lim_{h \to 0} h \cos(\frac{\pi}{h}) = 0. \] Since the limit exists and is finite, the function is differentiable at $x=0$, and $f'(0)=0$.