Continuous function whose right hand derivative equals 0 is constant? Let $f$ be a continuous function on the interval $[a,b]$ such as for all x in $(a,b)$ :
The right hand derivative equals $0$.
Is $f$ constant? 
The obvious reflex one would have is to try to find a counter-example, I tried, many times and I always failed.
I assumed it to be true and tried to prove it, I tried manipulating sequences, it never worked.
I tried calculating the left hand derivative of a point by using a sequence, it seemed to work at first, but it didn't as well.
All in all, I think $f$ may not be necessarily constant.
 A: Yes, $f$ is necessarily constant.
One can proceed similarly as in the proofs of the mean value theorem and  Rolle's theorem for differentiable functions.
It suffices to show that $f(c) = f(d)$ for $a < c < d < b$. The continuity of $f$ then implies that $f$ is constant on $[a, b]$.
Assume that $f(c) \ne f(d)$, without loss of generality $f(c) < f(d)$. Consider the function
$$
g(x) = f(x) - (x-c)\frac{f(d)-f(c)}{d-c}
$$
for $x \in [c, d]$. The right-hand derivative of $g$ is
$$
g_+'(x) = f_+'(x) - \frac{f(d)-f(c)}{d-c} = - \frac{f(d)-f(c)}{d-c} < 0
$$
for all $x \in [c, d)$.
But $g(c) = g(d)$, so that $g$ attains its minimum at a point $x_0 \in [c, d)$, where
$$ 
g_+'(x_0) = \lim_{x \to x_0^+} \frac{g(x)-g(x_0)}{x-x_0} \ge 0 \, ,
$$
which is a contradiction. This completes the proof.
A: Given $\epsilon>0$, we find for each $x\in[a,b)$, the set
$$ A_x:=\{\,\xi\in[a,b]\mid \xi>x,\left|\tfrac{f(\xi)-f(x)}{\xi-x}\right|\le \epsilon \,\}$$
contains some open interval $(x,y)$. Let $y^*(x)$ be the supremum of all $y$ with $(x,y)\subseteq A_x$. Clearly, $y^*(x)>x$. By continuity, $y^*(x)\in A_x$.
Suppose $y^*(a)<b$. 
Then for $y^*(a)<\xi<y^*(y^*(a))$, we have
$$\frac{f(\xi)-f(a)}{\xi-a}=\frac{\xi-y^*(a)}{\xi-a}\cdot\frac{f(\xi)-f(y^*(a))}{\xi-y^*(a)}+ \frac{y^*(a)-a}{\xi-a}\cdot\frac{f(y^*(a))-f(a)}{y^*(a)-a},$$
which is a convex combination of numbers $\in[-\epsilon,\epsilon]$. We conclude that $\xi\in A_a$. It follows that $y^*(a)\ge y^*(y^*(a))$, contradiction. 
We conclude that $y^*(a)=b$, so $A_a=(a,b]$. As $\epsilon$ was arbitrary, $f$ must be constant.
