Example of function where one-sided directionaly derivative does not exist

convex-analysisderivativesreal-analysis

One can show that for convex functions $f: \mathbb{R}^d \to \overline{\mathbb{R}}$ the so-called one-sided directional derivative exists:

Let $x_0 \in \mathbb{R}^d$ be a point where $f$ is finite. Then this derivative is given as the following if the finite or infinite limit

$$
Df(x_0,v) := \lim_{h^{+} \to 0} \frac{f(x_{0}+ hv) – f(x_{0})}{h}
$$

exists. It's quite a different notion to a "normal" derivative since we also allow infinite limits. An example of this is $f(x) = -\sqrt{x}$ for $x \ge 0$ where we can see that:

$$
Df(0,1) = \lim_{h^{+} \to 0} -\frac{1}{\sqrt{h}} = -\infty
$$

I was wondering what a good example is of a (continuous?) function where the one-sided directional derivative does not exist (thus also not convex). I guess I could construct some highly non-continuous function like

$$
f(x) = \begin{cases}
x, & \text{ if } \left \lceil{1/x}\right \rceil \mod 2 = 0\\
-x, & \text{ else.}\\
\end{cases}
$$

Best Answer

One example could be $f(x)= \begin{cases} x \sin \frac{1}{x}, & x \ne0 \\ 0, & x=0\end{cases}$.