# If $f$ is continuous and its left or right derivative is bounded then $f$ is Lipschitz continuous

Problem: Suppose that $$f:\mathbb{R}\rightarrow\mathbb{R}$$ is continuous. Furthermore, suppose that the right derivative exists everywhere and is bounded, i.e., $$|f'_{+}|. (or suppose that the left derivative exists everywhere and is bounded). Then $$f$$ is Lipschitz continuous.

I tried to prove this by all I managed to show is that $$f$$ is locally Lipschitz continuous.

My Attempt: From the definition of the right derivative we have \begin{align} |f'_{+}(x)| =\left|\lim_{h\rightarrow0^+} \frac{f(x+h)-f(x)}{h}\right|\leq M \end{align} Fix $$\epsilon>0$$. Then from the above we know that there exists $$h>0$$ such that for all $$h' we have \begin{align} \left| \frac{f(x+h')-f(x)}{h'}\right|\leq M+\epsilon \end{align} It follows that for all $$y\in\mathbb{R}$$ such that $$|y-x| we have \begin{align} \left| \frac{f(y)-f(x)}{y-x}\right|\leq M+\epsilon \end{align} So this shows that $$f$$ is locally Lipschitz continuous. But I cannot see how to extend this approach to the whole domain.

Further context: I am self-studying Royden and a similar result appears in the chapter on absolutely continuous functions (Chapter 5 in 3rd edition) as an exercise and I was not able to crack it either.

Consider $$g(x)=f(x)+Mx$$; continuous, right differentiable and $$g_{+}'(x)>0$$. But now for a fixed $$x$$ there is $$h_x>0$$ st for $$y\in (x, x+h_x)$$ we have $$g(y)>g(x)$$ so $$g$$ is locally increasing (from the right); a standard argument implies that $$g$$ is (non necesarily strictly) increasing on the real line
(assume $$y>x, g(y) < g(x)$$; let $$w=\inf_{z\in [x,y]}g(z) < g(x)$$; by the above $$x \ne w$$ and then $$g(x) so $$g(x)=g(w)$$ but by definition of $$w$$, there is $$z_n \to w,z_n >w, g(z_n) contradicting the existence of $$h_w$$ above)
So $$f(x)+Mx \le f(y)+My, y>x$$ so $$f(x)-f(y) \le M(y-x)$$
Consider $$h(x)=f(x)-Mx$$; the same reasoning shows that one is (not necessarily strictly) decreasing on the real line, so $$f(x)-Mx \ge f(y)-My, y>x$$ so $$f(y)-f(x) \le M(y-x)$$
Together the two inequalities show $$|f(x)-f(y)| \le M|x-y|$$