# $f$ continuous iff $\operatorname{graph}(f)$ is compact

The Problem: Let $(E,\tau_E)$ be a compact space and $(F,\tau_F)$ be a Hausdorff space. Show that a function $f:E\rightarrow F$ is continuous if and only if its graph is compact.

My Work: First assume $(E,\tau_E)$ compact and $(F,\tau_F)$ a Hausdorff space . Assume $f:E\rightarrow F$ continuous. Then certainly $f(E)$ is compact. Then $$\operatorname{graph}(f)\subseteq E\times f(E)\subseteq E\times F.$$ Since the graph is closed ( we know this since $(F,\tau_F)$ Hausdorff and $f$ continouous) and $E\times f(E)$ is compact, as the product of two compact sets, than somehow this should give us that $\operatorname{graph}(f)$ compact. I was thinking the canonical projections would be helpful here but i'm unsure.

As for the other way, I'm unsure. Any help is appreciated.

-
You are very close in the direction you started. You have shown that the graph is a closed subset of $E\times f(E)$, which is compact. Closed subsets of compact spaces are compact, right? As for the other direction, you know the projection $\pi_F\colon \mathrm{graph}(f)\to F$ is continuous and the projection $\pi_E\colon \mathrm{graph}(f)\to E$ is closed (why?). You should be able to use these facts to get what you want. – froggie May 10 '12 at 1:16
Another similar but not the same post. I've heard three versions of this question in the last few weeks.. must be pretty popular. – rschwieb May 10 '12 at 1:32
Thanks for the help! – Mathstudent May 10 '12 at 2:30
@Mathstudent How do you know that the graph of $f$ is a closed subset of $E \times f(E)$? – user38268 May 10 '12 at 10:12

$\textbf{Attention Mathstudent:}$ I think you need to assume that $E$ is Hausdorff.

Here are some preliminary thoughts on your problem . I think we are ready to prove the other direction. Recall that if you can show that given any closed set $B$ in $Y$, the preimage under $f$ is also closed then you have proven that $f$ is a continuous function. Now we already know that the canonical projection $\pi_2 : E \times F \longrightarrow E$ is a continuous function. Therefore since $(E \times B) = \pi_2^{-1}(B)$ and $B$ is closed it follows that $(E \times B)$ is a closed subset of $E \times F$. Furthermore we know that $\operatorname{graph}(f)$ is a compact subset of $E \times F$ so consider

$$\operatorname{graph}(f) \cap (E \times B).$$

Now note that $\operatorname{graph}(f) \cap (E \times B)$ is closed in the graph of $f$. Since a closed subspace of a compact space is compact, it follows that

$$\operatorname{graph}(f) \cap (E \times B)$$

is compact. Now we use the following theorem from Munkres:

$\textbf{Theorem 26.6 (Munkres)}$ Let $f : X \rightarrow Y$ be a bijective continuous function. If $X$ is compact and $Y$ is Hausdorff, then $f$ is a homeomorphism.

In our case we have $f$ being $\pi_1|_{\operatorname{graph}(f)}: E \times F \longrightarrow F$, $X = \operatorname{graph}(f)$ and $Y= E$. Now note that $\pi_1$ when restricted to the graph of $f$ becomes a bijective function. To be able to apply your theorem we need that $E$ is Hausdorff (because otherwise the hypotheses of the theorem are not satisfied). Assuming this, the theorem gives that since $\Big(\operatorname{graph}(f) \cap (E \times B)\Big)$ is a compact subset of the graph,

$$\pi_1|_{\operatorname{graph}(f)} \Big(\operatorname{graph}(f) \cap (E \times B)\Big) = f^{-1}(B)$$

is compact. Now we use the assumption again that $E$ is Hausdorff: Since $f^{-1}(B)$ is a compact subset of $E$ that is Hausdorff it is closed so you are done.

$\hspace{6in} \square$

-
,hi, I am confused about the two canonical projections, pi1 and pi2, you write "π2:E×F →E is a continuous function. Therefore since (E×B)=π−1(B)", if π−1(B) were to be E×B, shouldn't π2:E×F →F? Thanks – Bob Mar 16 '14 at 8:43