Show that a continuous function on a compact set satisfies this bound. Problem: Suppose $K\subseteq \mathbb{R}^n$ is compact, $f: K\to \mathbb{R}$ is continuous, and $\epsilon&gt;0$. Show that there is a number $A&gt;0$ such that
$$|f(x)-f(y)| \leq A\|x-y\| + \epsilon,\;\forall x,y\in K. $$

Attempt at solution: By uniform (since $K$ is compact) continuity, there is a $\delta&gt;0$ such that $\|x-y\| &lt; \delta$ implies $|f(x)-f(y)|&lt;\epsilon$. By compactness we can cover $K$ with finitely many, say $N$, such $\delta$-balls. Since the image of $K$ under $f$ is compact, can we do something like cover the image with finitely many $\epsilon$-balls? I'm just not sure how I can get a bound in terms of $\|x-y\|$.
Another method: Let $\epsilon&gt;0$. By uniform continuity, take $\delta&gt;0$ so that $|f(x)-f(y)|&lt; \epsilon$ whenever $\|x-y\|&lt; \delta$. Define $$A:= \max_{\|x-y\|\geq \delta} \frac{|f(x)-f(y)|}{\|x-y\|}$$ Note that this maximum is finite (and achieved) since $\{(x,y)\in K \times K : \|x-y\| \geq \delta\}$ is a compact set (being a closed subset of the compact set $K \times K$), and the expression being maximized is a continuous function on that set.

Then for $\|x-y\| \leq \delta$, we have that $|f(x)-f(y)| \leq \epsilon$, and for $\|x-y\| \geq \delta$, we have that $|f(x)-f(y)| \leq A\|x-y\|$, thus in general $$|f(x)-f(y)| \leq \max\{\epsilon, A\|x-y\|\} \leq \epsilon + A\|x-y\|$$
Suppose it is not true, for every integer $n$, there exists $x_n,y_n\in K$ such that $|f(x_n)-f(y_n)|\geq n\|x_n-y_n\|+\epsilon$. Since $K$ is compact, we can extract a sequence $(x_{n_k})$ from $x_n$ which converges towards $x$ and a sequence $({y_{n_k}}_l)$ from $(y_{n_k})$ which converges towards $y$, remark that $({x_{n_k}}_l)$ converges also towards $x$. To simplify the notation, we write ${x_{n_k}}_l=x_l$. We have $|f(x_l)-f(y_l)|\geq l\|x_l-y_l\|+\epsilon$. Since $f$ is continue, we deduce that $|f(x)-f(y)|\geq l\|x-y\|+\epsilon$ for an infinite number of distinct integers $l$. This implies that $\|x-y\|=0$ and $x=y$. We deduce that $|f(x)-f(x)|\geq l\|x-x\|+\epsilon$ where $\epsilon&gt;0$. Contradiction.