locally lipschitz implies lipschitz

Suppose a function $f:\mathbb{R}\rightarrow\mathbb{R}$ is locally Lipschitz. Prove $f$ is Lipschitz on $[a,b]$.

Here is what I have so far: Let $[a, b]$ be some closed, bounded interval. Since f is locally Lipschitz, for each $x\in[a; b]$, we may find some $U_x$ and some $M_x$ such that $|f(y)-f(z)| < M|x-y|$. Let $\mathcal{U}$ denote the collection of all such open neighborhoods $U_x$. Then $\mathcal{U}$ is an open cover of $[a, b]$. By the Heine-Borel Theorem, $[a, b]$ is compact, so $\mathcal{U}$ has a finite subcover, \mathcal{V}. Label the members of $\mathcal{V}$ as $U_{x_1}, U_{x_2},\ldots,U_{x_n}$. Then $[a, b]$ and for each $U_{x_k}$, we associate a corresponding $M_{x_k}$ such
that if $y, z\in U_{x_k}$ , then $|f(y)-f(z)|< M_{x_k}|y-z|$. Let $M = \max\{M_{x_1},\ldots,M_{x_n}\}$. Let y and z be some points in $[a, b]$ with z < y. If both y and z lie in the same neighborhood in $\mathcal{V}$, then we are done.

This is as far as I got. I do not know how to handle the case when $y$ and $z$ are in different neighborhoods.

Solutions Collecting From Web of "locally lipschitz implies lipschitz"

Very good work so far.

By the lebesgue covering lemma, there exists $\delta >0$ s.t. if $x,y$ satisfy $|x-y|<\delta$ then there is $k$ s.t. $x ,y \in U_{x_k}$.

Let $x<y$. Choose $x=x_1\leq x_2 \leq \dots \leq x_n = y$ s.t. $|x_i – x_{i+1}| < \delta$. Then we have $|f(x)-f(y)| \leq |f(x_1) -f(x_2)| + |f(x_2) -f(x_3)|+\dots + |f(x_{n-1}) – f(x_n)| \leq \sum_i M |x_i-x_{i+1}| = M|x-y|$