Real Analysis – Continuity of Real Function on Compact Set

compactnessgeneral-topologyreal-analysis

I have a problem with the following

Let $X$ be a compact subset of $\mathbb{R}$ and let $f$ be a real-valued function on $X$. Prove that $f$ is continuous if and only if $\{(x,f(x)) \mid x\in X\}$ is compact subset of ${\mathbb R}^2$.

I have done $\Rightarrow$ direction but with the other direction I could use some help.

Best Answer

A general topology answer: suppose $f: X \rightarrow Y$ has a compact graph $\Gamma(f) = \left\{(x,f(x)): x \in X\right\} \subset X \times Y$. Also suppose $X$ is Hausdorff.

Now let $F \subset Y$ be closed. To show continuity of $f$, it suffices to show that $f^{-1}[F]$ is closed in $X$. Define $\pi: X \times Y \rightarrow X$ by $\pi(x,y) = x$, the projection onto the first coordinate, which is continuous. Then:

$$f^{-1}[F] = \pi[(X \times F) \cap \Gamma(f)]$$

($x \in f^{-1}[F]$ iff $f(x) \in F$, which means $(x,f(x)) \in \Gamma(f) \cap (X \times F)$, and $\pi(x,f(x)) = x$, so $x$ is in the right hand side. On the other hand, if $x$ is in the right hand side, we have $(x,y) \in (X \times F) \cap \Gamma(f)$ for some $y (\in F)$ and being in $\Gamma(f)$ forces $y = f(x)$ , and so $y = f(x) \in F$, so $x \in f^{-1}[F]$.)

Now $X \times F$ is closed in $X \times Y$ so its intersection with $\Gamma(f)$ is closed in $\Gamma(f)$, which is compact. So $(X \times F) \cap \Gamma(f)$ is compact as well, being closed in a compact set. And so its continuous image under $\pi$, which equals $f^{-1}[F]$ as we saw, is compact too. But if $X$ is Hausdorff, this implies it's closed, and we are done.

So the only thing we need of being a subset of $\mathbb{R}$ is that it guarantees Hausdorffness.

Related Question