I'm currently practicing how to approach problems in my own without mimicking solutions in textbooks. So, the problem I am solving is this: Let $f:[a,b]\to \Bbb{R}$ be continuous. Then $f$ is uniformly continuous
Here is what I have done:
Let $x_0\in[a,b]$ be arbitrary, such that for every $\{x_n\}\subset [a,b],\;\;x_n\to x_0$ as $n\to\infty.$ By the continuity of $f$ at $x_0$, $f(x_n)\to f(x_0)$ as $n\to\infty$ for some $f(x_0)\in \Bbb{R}$. Since $[a,b]$ is compact, i.e., closed and bounded, then for any $\{x_n\},\{y_n\}\subset [a,b]$ with $x_n\to x_0$ and $y_n\to x_0$ as $n\to\infty,$ we must have $f(x_n)\to f(x_0)$ and $f(y_n)\to f(x_0)$ as $n\to\infty$. So, let $\epsilon>0$ be given, then $\exists\;\delta=\delta(x_0,\epsilon)>0$ s.t. $|x_n-x_0|<\delta/2$ and $|y_n-x_0|<\delta/2 \implies|f(x_n)-f(x_0)|<\epsilon/2$ and $|f(y_n)-f(x_0)|<\epsilon/2$.
Now, $|x_n-y_n|=|x_n-x_0+x_0-y_n|\leq |x_n-x_0|+|y_n-x_0|<\delta/2+<\delta/2=\delta$.
Remark: This new $\delta$ only depends on $\epsilon.$
Thus, for every $\{x_n\},\{y_n\}\subset [a,b]$ with $|x_n-y_n|<\delta$, we have $$|f(x_n)-f(y_n)|=|f(x_n)-f(x_0)+f(x_0)-f(y_n)|$$ $$\leq|f(x_n)-f(x_0)|+|f(y_n)-f(x_0)|$$ $$<\epsilon/2+\epsilon/2=\epsilon$$
Hence, for any $\epsilon>0,\;\exists\;\delta=\delta(\epsilon)$ such that, for every $\{x_n\},\{y_n\}\subset [a,b]$ with $|x_n-y_n|<\delta$, we have $|f(x_n)-f(y_n)|<\epsilon$. So, $f$ is uniformly continuous.
So, can anyone help me debug this? What are my errors? Any better way of going about this? Kindly provide what I should have incorporated instead, if I was wrong!
It has several errors: