# $f:M_1\to M_2$ is continuous iff its graph is compact.

I have a propostion in Introduction to Real Analysis (3rd Ed.) which says:

If $M_1$ is compact, a function $f:M_1\to M_2$ is continuous iff its graph is compact.

Here $M_1$ and $M_2$ are either a subset of $\mathbb{R}^n$ (or metric spaces).

Is this proposition correct when $M_1$ and $M_2$ are topological spaces?!

EDIT: As Jonas Meyer noted, we need that $M_1$ is Hausdorff so that compact subspaces are closed.

EDIT EDIT: I assumed that, since you were looking at a book on Real Analysis, you would be considering almost expressly Hausdorff spaces (these are by-and-large the most important class of topological spaces fro basic math).

Yes. Note that the "graph map" $\Gamma_f:M_1\to M_1\times M_2:x\mapsto (x,f(x))$ is continuous and has the graph of $f$ as its image. Thus, the graph is a compact subset of the metric space $M_1\times M_2$ and thus closed.

Conversely, suppose that the graph $\Gamma_f$ is closed. We need to prove that if $C\subseteq M_2$ is closed then $f^{-1}(C)$ is closed. But, note that $f^{-1}(C)=\pi_1(\Gamma_f\cap (M_1 \times C))$. Note that $\Gamma_f\cap (M_1\times C)$ is a closed subset of the compact $\Gamma_f$ and so compact. Thus, its image $f^{-1}(C)=\pi_1(\Gamma_f\cap (M_1\times C))\subseteq M_1$ is compact and thus closed.

• I think you mean 'topological space' where you write 'metric space' (presumably, OP has this for metric spaces in his book, and wants the general topological space version). – gnometorule Feb 15 '13 at 6:22
• This is for $M_1$ Hausdorff. – Jonas Meyer Feb 15 '13 at 6:22
• Take $f=id$ from $\mathbb{Z}$ with indescrete topology to $\mathbb{Z}$ with cofinite topology – Dominic Michaelis Feb 15 '13 at 6:27
• yeah i hope so :) i didn't have topology till now but i am pretty sure this is a counter example – Dominic Michaelis Feb 15 '13 at 6:35