Is there a continuous function $f : \mathbb{R} \to \mathbb{R}$ which has left and right derivatives everywhere, but where those derivatives are unequal at every point?



Can one-sided derivatives always exist, but never match?
No, that cannot happen. 


Let's use a Baire category argument. More precisesly: a pointwise limit of a sequence of continuous functions $\mathbb R \to \mathbb R$ is continuous everywhere except for a meager set [= set of first category]. [ref.](https://mathoverflow.net/a/32039/454) 


Let $f : \mathbb R \to \mathbb R$ be continous. Assume the left-hand derivative $f^-(x)$ and the right-hand derivative $f^+(x)$ exist everywhere. Let
$$
f\_n(x) = \frac{f(x+1/n)-f(x)}{1/n}
$$
Then each $f\_n$ is continous and $f\_n(x) \to f^+(x)$ everywhere. Therefore, $f^+$ is continuous everywhere except for a meager set. Similarly, $f^-$ is continuous everywhere except for a meager set. So there is a point $a$ such that $f^+$ and $f^-$ are both continuous at $a$.


By assumption, $f^-(a) \ne f^+(a)$. Replacing $f$ by $-f$, if necessary, we may assume WLOG that $f^-(a) > f^+(a)$. Adding a linear function to $f$, if necessary, we may assume WLOG that $f^-(a) > 0 > f^+(a)$. Because $f^+, f^-$ are continuous at $a$, there is $\delta > 0$ so that
$$
\forall u \in [a-\delta,a+\delta] \quad f^-(u) > 0\text{ and }
 f^+(u) < 0 .
$$
Now, consider a point $u \in [a-\delta,a+\delta]$. Because $f^-(u) > 0$, there is $\alpha\_u < u$ so that
$$
\forall x\in(\alpha\_u,u),\quad \frac{f(u)-f(x)}{u-x} > 0, \text{ so } f(x) < f(u).
$$
Because $f^+(u) < 0$, there is $\beta\_u > u$ so that
$$
\forall x\in(u,\beta\_u),\quad \frac{f(x)-f(u)}{x-u} < 0, \text{ so } f(x) < f(u) .
$$
Thus, there is a neighborhood $(\alpha\_u,\beta\_u)$ of $u$ such that $f(x) < f(u)$ for all $x \in (\alpha\_u,\beta\_u)\setminus\{u\}$. So $f$ has a strict local maximum at $u$. But $f$ is continuous on $[a-\delta,a+\delta]$, and therefore achieves its minimum value at some point $u \in [a-\delta,a+\delta]$. A contradiction.


