# Continuity and Differentiation on a interval

$$f(x) = \begin{cases} x\sin(1/x), & \text{if x \ne 0} \\ 0, & \text{if x = 0} \\ \end{cases}$$

Is $f$ continuous on $(-1/\pi$, 1/$\pi$)? Is $f$ differentiable on $(-1/\pi$, 1/$\pi$)?

I have a question with this problem. I know how to prove continuity on a single point, bu I'm not sure how to prove continuity for a whole interval. Also, I know there is a theorem that states that if a function is differentiable at a point, then it's continuous but I have a feeling that $f(x)$ is continuous but not differentiable.

• To prove continuity in internal go for critical point at x =0 because at other places function is xsin(1/x) which is continuous as it is product of two continuous function – DSinghvi May 9 '14 at 19:07
• I remember this function when I was in High School, my professor gave this an example of function which is continuous but not differentiable. – Santosh Linkha May 9 '14 at 19:16

To check continuity at $x=0$ use the squeeze lemma: clearly $-1< \sin x < 1 \ \forall x$, so $\lim_{x \to 0} f(x) =0 = f(x_0)$, so the function is continuous. To check differentiability use the definition: $f'(0) = \lim_{h \to 0} \frac{f(0+h)-f(0)}{h}$. what do you get?
By first principles $f'(0)=\lim_{h\to 0}\frac{f(h)-f(0)}{h}=\lim_{h\to 0}\frac{h\sin(1/h)}{h}=\lim_{h\to 0}\sin(1/h)$
Which is undefined, so yes it is not differentiable at $0$.
Your feeling is true. To check $f$ is continuous on$(-1/\pi,1/\pi)$, you only need to check $\lim_{x\to 0}f(x)=0$. This can be proved using Squeeze_theorem.
For the undifferentiability, prove that $$f^\prime(0)=\lim_{h\to 0}\frac{f(h)-f(0)}{h}=\lim_{h\to 0}\frac{h\sin(1/h)}{h}=\lim_{h\to 0}\sin(1/h)$$ doesn't exist.