Let $f:[a,b]\to\mathbb{R}$ be a piecewise-linear function, so that there is a partition of $I=[a,b]$: \begin{align*} a:=t_0<t_1<\cdots<t_n:=b \end{align*} such that on each $I_i:=[t_{i-1},t_i]$, $f(I_i)$ is a straight line segment $\ell_i$. Denote the absolute value of the slope of $\ell_i$ by $m_i$.
My question is as follow: Suppose $\exists M>0$ such that for all $i$, we have \begin{align*} m_i\leq M \end{align*} Show that for any $x,y\in I$ with $x\neq y$, \begin{align} \left|\frac{f(x)-f(y)}{x-y}\right|\leq M \end{align} That is, the absolute value of the slope of the line segment connecting $(x,f(x))$ and $(y,f(y))$ is also no greater than $M$.
At first glance the problem seems easy. One just plays around with inequalities. However, I keep getting a less sharp result that the L.H.S. is $\leq\nu M$, where $\nu$ depends on the number of $t_i$'s between $x$ and $y$. How can I improve?
Thanks in advance for any comments.
For each $i$, $$-M(t_i-t_{i-1})\le f(t_i)-f(t_{i-1})\le M(t_i-t_{i-1}).$$ Add these up to get $$-M(b-a)\le f(b)-f(a)\le M(b-a).$$
But you said, any two points, not just the endpoints $a$ and $b$. Never mind, restricting to an subinterval gives a piecewise linear function still with slopes between $\pm M$.