TITLE: Can one-sided derivatives always exist, but never match?
QUESTION [12 upvotes]: 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?

REPLY [14 votes]: 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. 
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.