Does continuity imply existence of one sided derivatives?

From what I understand a derivative may not exist at a given point if the function is not continuous or the right and left side derivatives are not equal. Does that imply that if a function is continuous, the one sided derivatives exist at it's every point?

• No​​.​​​​​​​​​​ – user2345215 Mar 9 '14 at 16:44
• and why exactly? – Marek Mar 9 '14 at 16:49
• @user2345215 : I am impressed with your answer :) – mesel Mar 9 '14 at 16:50
• No, you can find a counterexample where a function is continuous but extremely irregular, for example a sample path of Brownian motion. – Chival Mar 9 '14 at 16:50
• @Marek: gave you an example now :) – user2345215 Mar 9 '14 at 17:13

For an elementary example, consider

$$f(x) = \begin{cases} \displaystyle x\sin\frac1x & \text{if } x \neq 0, \\ 0 & \text{if } x = 0.\end{cases}$$

This is obviously continuous, but can't be differentiable on either side of $0$, because the function has points on lines $y=x$ and $y=-x$ arbitrarily close to $0$.

• This is the kind of example I would have given. – Lubin Mar 9 '14 at 17:22

As user2345215 already said, it does not. Weierstrass function is an example of a function that is continuous, but differentiable nowhere, and has no one-sided derivative at any point.

• But note that one-sided "derivatives" can be $\infty$ or $-\infty$. I wouldn't be satisfied until I found an example where even this can't happen :) – user2345215 Mar 9 '14 at 17:15

No, consider the function $$f(x) = \begin{cases} \displaystyle x\sin (1/x) & \text{if } x \neq 0, \\ 0 & \text{if } x = 0.\end{cases}$$ It is continuous on $\mathbb{R}$, but it has not sided derivatives in $x = 0$.

[EDIT: Thanks to a joke of my poor brain, in my first answer I put $f(x) = \sin(x)/x$ for $x\neq 0$ and $f(0) = 1$ (that is a completely wrong counterexample!), instead of the true function I had in mind. :P ]

• This answer is completely wrong! This function is infinitely differentiable on $\mathbb{R}$ (analytic on $\mathbb{C}$, even). – Hans Lundmark Mar 9 '14 at 17:07
• +1 to your comment!! I completely agree! Sorry, in the hurry of putting the answer online, I wrote the wrong function, that is of course $\sin(1/x)x$ as @user2345215 said! I beg your pardon :) – Paglia Mar 10 '14 at 7:44
• OK, that's better. :-) – Hans Lundmark Mar 10 '14 at 10:15