f: [-1, 1]---R and the graph of f is compact, prove that f is continuous?

Any hint will be appreciated!!

2. Assume that the graph is compact. Assume for contradiction that $f$ is discontinuous at $x_0 \in [-1,1]$. Then there exists an $\epsilon > 0$ and a sequence $\{x_n \} \subset [-1,1]$ such that $\{x_n \}$ converges to $x_0$. Look at the sequence $\{(x_n, f(x_n)) \}$. Since the graph is compact it has a subsequence $\{(x_{n_{k}}, f(x_{n_{k}})) \}$ which converges to a point $(x_1, f(x_1))$. So $\{x_{n_{k}} \}$ converges to $x_1$. But $\{f(x_{n_{k}}) \}$ converges to $f(x_0)$ which is a contradiction. This implies that $G(f) \to X$ is continuous and onto.

3. Originally Posted by violetsf
f: [-1, 1]---R and the graph of f is compact, prove that f is continuous?

Any hint will be appreciated!!
What about the Dirichlet function . Meaning rationals get mapped into 0 and irrationals into 1. So the image of [-1,1] is {0,1} which is certainly compact.
--------
Tukeywilliams, I think she is asking the converse.

4. I think I proved the right statement?

5. I was thinking whether f(x0)=f(x1) ??
Originally Posted by tukeywilliams
I think I proved the right statement?

6. Originally Posted by tukeywilliams
I think I proved the right statement?
This is my understanding. By "graph" the poster means "image".

So the poster is asking: given a function mapping a compact set ([-1,1] is compact) into a compact set does it mean that the function is continous on the set?
That is what I did.

Now, I gave an example involving the Dirichelt (discontinous) function which shows it is false. You are saying you proved it, if so, then why do I have a conter-example?

7. $f$ is continuous on $[-1,1]$ if and only if $G(f)$ is compact. I proved the $\Leftarrow$ direction.

I defined $G(f) = \{x, f(x))| x \in [0,1] \}$

8. Originally Posted by tukeywilliams
$f$ is continuous on $[-1,1]$ if and only if $G(f)$ is compact. I proved the $\Leftarrow$ direction.

I defined $G(f) = \{x, f(x))| x \in [0,1] \}$
I am not going to read your proof now, but I think I see out difference. You use $\{ (x,f(x)) \}$, i.e. as a point in $\mathbb{R}^2$, while I used $\{ f(x) \}$ as a point in $\mathbb{R}$. So maybe it is necessary for it to be continous.