If $E$ is compact and the graph of $E$ is compact then $f$ is continuous.

analysiscompactnesscontinuitysolution-verification

This is a question from Rudin and I know there are many answers to the question but I am trying to solve rudin on my own and needed someone to go through the proof which I think is probably not correct.Any help to rectify it will be appreciated.

Here's my attempt :

Let $E$ be a compact set and the graph of $E$ is defined as $(x, f(x))$ which is compact. We need to show that $f$ is continuous.

Now, we assume that $f(x)$ is discontinuous at the point $x_1$.Then there is a sequence $(x_n)$ which converges to $x_1$ such that $f(x_n)$ is not convergent at $f(x_1)$ . Now we consider the sequence $(x_n,f(x_n))$ which has a convergent subsequence say $(x_{n_k},f(x_{n_k})$ which has to converge to $(x_1,f(x_1))$ . Since the original sequence $f(x_n)$ is discontinuous at $x_1$ so $|f(x_n)-f(x_1)| \ge \epsilon$ for all $n \ge K_1$.
However $f(x_{n_k}) \to f(x_1)$ so $|f(x_{n_k})-f(x_1)| < \epsilon$ for all $n_k \ge k \ge K_2$.
This is what the contradiction that I have found out. I know this is wrong and I need some one to rectify it.

Best Answer

First of all you using $x_1$ with two meanings. Suppose $f$ is not continuous at $x$. Then there exists $r>0$ and $x_n \to x$ such that $|f(x_n)-f(x)| \geq r$ for all $n$. Now, Since the graph is compact, $(x_n,f(x_n))$ has a subsequence $(x_{n_k}, f(x_{n_k}))$ converging to some point $(u,f(u))$ on the graph. This implies $x_n\to u$ so we must have $u=x$ and $f(x_{n_k}) \to f(u)=f(x)$. But $|f(x_{n_k})-f(x)| \geq r$ for all $k$ and we have arrived at a contradiction.

Related Question