Solution (source code)

= Solution

A real function on a <metric space> is <uniformly continuous> if for every $\varepsilon>0$ there is a $\delta>0$ such that, simultaneously for all $x,y$, $d(x,y)<\delta$ implies $|f(x)-f(y)|<\varepsilon$. For a continuous function on a finite closed interval $[a,b]$, suppose this fails. Then there are $\varepsilon_0>0$ and pairs $x_n,y_n$ with $|x_n-y_n|<1/n$ but $|f(x_n)-f(y_n)|\ge\varepsilon_0$. By <compactness>, some subsequence $x_{n_j}$ converges to $x\in[a,b]$; then $y_{n_j}\to x$ too. <Continuity> contradicts the image separation. This proves the <Heine-Cantor theorem> in this setting. Boundedness of the interval matters: $x^2$ on $[0,\infty)$ is a counterexample if “closed interval” includes unbounded intervals.

A function is <Lipschitz continuous> if some finite $K\ge0$ satisfies $|f(x)-f(y)|\le Kd(x,y)$ for every pair. Choosing $\delta=\varepsilon/(K+1)$ proves <uniform continuity>.

The first assertion is \b[false]. Take $f(x)=\sin(x^2)$, which is bounded and continuous, and
$$
x_n=\sqrt{2\pi n+\pi/2},\qquad y_n=\sqrt{2\pi n+3\pi/2}.
$$
Then $f(x_n)=1$, $f(y_n)=-1$, while $y_n-x_n=\pi/(y_n+x_n)\to0$. This violates <uniform continuity>.