Functions which are continuous but the left-hand and right-hand derivatives do not exist I'll state my question up-front, and then provide some motivation afterwards. Is there an example of a function that is

*

*Defined in a neighbourhood of a point $a$,

*Continuous at $a$,

*But neither the left-hand nor the right-hand derivative exists at $a$,

and that it is 'visually obvious' that the function has these properties (so pathological functions like the Weierstrass function are excluded). For the purposes of this question, I will define 'visually obvious' as meaning that it is possible to guess that the function has the above properties just by looking at its graph.

The function $f(x)=|x|$ is probably the simplest example of how a function can be continuous, and yet not differentiable, at a point:

It is clear just by looking at the graph that $f$ is continuous at $0$, but $f'(0)$ does not exist as $f'_+(0)=1$ and $f'_-(0)=-1$. However, what I find unsatisfying about this example is that $f$ is still fairly well-behaved around $0$—it is meaningful to ask about the 'rate of change' of the function, it's just that we get different answers when we zone in from the left-hand side compared to the right-hand side. I'm looking for a function where it is not meaningful to talk about the 'rate of change' at all, and yet the function is still continuous at the point in the question.
 A: Consider the function $x\sin(1/x)$, continuously extended at $0$. The left and right derivatives at $0$ don't exist as $\sin(1/h)$ keeps oscillating between $-1$ and $1$ as $h\to 0$:

A: You don’t seem to have understood my comment so let me try an answer. The weierstrass function, $|x|^s$, $x\sin1/x$, these functions are all continuous on a neighbourhood of 0. But your question is asking for functions continuous only at one point.  So you can consider the function $f:\mathbb R\to\mathbb R$,
$$f(x)=\begin{cases} x &x\in \mathbb Q\\ -x &x\not\in \Bbb Q\end{cases}$$
Note that the function is everywhere defined on $\mathbb R$. Its graph is X shaped, consisting of the two lines $y=\pm x$ (what you can’t ‘draw’ is that there are infinitely many holes in any interval.) Clearly there are two candidates for the (left or right) gradient at $0$; since the (left or right) gradient must be unique, it’s not (left or right) differentiable at $0$. But it is continuous at $0$. It’s not continuous anywhere else (and therefore, not differentiable anywhere else.)
A: Another fairly standard example is $f(x) = x^{2/3}$, which (like the absolute value function) has a cusp at $x = 0$, but which (unlike the absolute value function) has neither a left-handed nor a right-handed derivative, because the graph of $y=f'(x)$ has a vertical asymptote at $x = 0$.

