Is this a valid proof of $f:[a,b]\to\mathbb{R}$ continuous $\implies$ $f$ uniformly continuous?

169 Views Asked by At

I'm wondering whether this proof (which I tried to put together myself, for practice) is valid, or if you can find any flaw in my reasoning, or if I'm doing something unnecessarily complicated.

Theorem: Assume that $a,b\in\mathbb{R}$ and that $f:[a,b]\to\mathbb{R}$ is continuous (on all points of $[a,b]$). Then $f$ is uniformly continuous.

Proof: We assume the opposite and get a contradiction. Assume that $f$ is not uniformly continuous, so that there exists an $\varepsilon_0>0$ such that for every $\delta>0$, we can find points $x,y\in[a,b]$ such that $|x-y|<\delta$ but $|f(x)-f(y)|\geq\varepsilon_0$. Then we can build two sequences $(x_n)$ and $(y_n)$ for which $|x_n-y_n|<1/n$ but $|f(x_n)-f(y_n)|\geq\varepsilon_0$. Due to Bolzano Weierstrass' theorem, $(x_n)$ contains a convergent subsequence $(x_{k_n})$, which converges to, let's say, $x$. Now, since $f$ is continuous at $x$, there exists a $\delta>0$ such that $|x-c|<\delta$ implies $|f(x)-f(c)|<\varepsilon_0/2$. But we can choose $n$ big enough such that $|x_n-x|<\delta$ and $|y_n-x|<\delta$ and $|x_n-y_n|<\delta/2$ yet $|f(x_n)-f(y_n)|\geq\varepsilon_0$. Thus $\ |f(x_n)-f(y_n)|\leq|f(x_n)-f(x)|+|f(x)-f(y_n)|<\varepsilon_0/2+\varepsilon_0/2=\varepsilon_0, $ a contradiction. Thus $f$ is uniformly continuous.