# 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.

• Doesn't differentiable imply right hand derivative = left hand derivative? Jan 13, 2020 at 22:00
• Oops I made a mistake, the function isn't differentiable. Jan 13, 2020 at 22:01
• Try $f(x) = 1$ when $x\geq0$ and $f(x) = 0$ otherwise. Jan 13, 2020 at 22:09
• on which interval? and would it even be continuous? Jan 13, 2020 at 22:11
• Oops, my $f$ was not continuous! Jan 14, 2020 at 21:11

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.

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). Then for $$y^*(a)<\xi, 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.

• could you clarify what do you mean by a convex combination of numbers? Jan 13, 2020 at 22:40