# $f$ is Continuous if and only if its Graph is Closed in $X \times Y$

Let $$f: X \to Y$$; let $$Y$$ be compact Hausdorff. Then $$f$$ is continuous if and only if $$G_f = \{(x,f(x)) \mid x \in X \}$$ is closed.

Here is my shot at a proof:

Suppose that $$f : X \to Y$$ is continuous, and let $$(x,y) \in \overline{G_f}$$ but assume $$y \neq f(x)$$. As $$Y$$ is Hausdorff, there exists $$U,V$$ open in $$Y$$ and disjoint such that $$y \in U$$ and $$f(x) \in V$$. Since $$V$$ is a nbhd of $$f(x)$$ and $$f$$ is continuous, there exists an $$O \subseteq X$$ that is open and contains $$x$$ such that $$f(O) \subseteq V$$. Since $$O \times U$$ is an open nbhd of $$(x,y)$$, there must be some $$(p,q) \in G_f \cap O \times U$$. This means $$p \in O$$ and that $$f(p)=q \in U$$. But $$f(O) \subseteq V$$, so $$U$$ and $$V$$ must intersect--a contradiction. Hence $$y= f(x)$$ and $$G_f$$ must be closed.

Now we show the other direction. Suppose that $$G_f$$ is closed, let $$x \in X$$ be arbitrary, and let $$V$$ be a open nhbd of $$f(x)$$. Then $$Y-V$$ is closed, and therefore the intersection $$C:=G_f \cap [X \times (Y-V)]$$ is closed in $$X \times Y$$. By an earlier problem, we know that $$\pi_1$$ is a closed map and so $$\pi_1(C)$$ is closed in $$X$$, and therefore $$X-\pi_1(C)$$ is open. I will argue that $$x \in X-\pi_1(C)$$ by contradiction. If $$x$$ were in $$\pi_1(C)$$, then there would exist a $$p \in X$$ and a $$q \in Y-V$$ such that $$f(p)=q$$ and $$x= \pi_1(p,f(p))$$ or $$x=p$$. But this would mean $$f(x)=q \in Y-V$$ or $$f(x) \notin V$$, which contradicts the assumption that $$V$$ is a nbhd of $$f(x)$$. Hence $$x \in X - \pi_1(C)$$.

Now we argue that $$a \in f^{-1}(V)$$ if and only if $$a \notin a \notin \pi_1(C)$$. Suppose that $$a \in \pi_1(C)$$. Then $$a = \pi(p,f(p))$$ or $$a=p$$ where $$f(p) \in Y-V$$. This means that $$f(a) \in Y - V$$ and therefore $$a \notin f^{-1}(V)$$. Now suppose that $$a \notin f^{-1}(V)$$. Then $$f(a) \notin V$$ and therefore $$f(a) \in Y-V$$. From this we get $$(a,f(a)) \in G_f \cap [X \times (Y-V)] = C$$ which implies $$a \in \pi_1(C)$$.

From this we can conclude that if $$a \in X-\pi_1(C)$$, then $$f(a) \in V$$, proving that $$f(X-\pi_1(C)) \subseteq V$$ which in turn proves that $$f$$ is continuous.

How does this sound?

• @RobArthan Whoops! Sorry about that--long day. I believe the errors have been fixed now. – user193319 Oct 24 '17 at 21:59

## 2 Answers

If you know that $\pi_X: X \times Y \to X$ is a closed map (which you seem to):

Suppose $G_f$ is closed.

Let $C \subseteq Y$ be closed. Then $G_f \cap (X \times C)$ is closed in $X \times Y$ and note that $\pi_X[G_f \cap (X \times C)] = f^{-1}[C]$ so that $f^{-1}[C]$ is closed in $X$, as $\pi_X$ is closed. So $f$ is continuous. (inverse image of closed is closed). This direction only uses compactness of $Y$.

For the other direction we only need the Hausdorffness of $Y$: The diagonal $\Delta_Y = \{(y,y) : y \in Y\} \subseteq Y \times Y$ is closed iff $Y$ is Hausdorff, and $G_f = (f \times 1_Y)^{-1}[\Delta_Y]$, where $1_Y$ is the identity on $Y$ and $f \times 1_Y : X \times Y \to Y \times Y$ defined by $(f \times 1_Y)(x,y) = (f(x), y)$ is continuous whenever $f$ is.

• Wow! Very nice! Thank you – user193319 Oct 24 '17 at 23:21

I think you are right. But, if you know the theory of "net", it will be more simple to prove this result. The proof is nothing but an analogue of the case that both $X$ and $Y$ are metric spaces.

Suppose that the graph is closed. Let $x_\alpha \to x$ in $X$, where $\{x_\alpha\}$ is any convergent net (not necessarily a sequence). Suppose by way of contradiction that $f(x_\alpha)\not\to f(x)$. Then there exists a neighborhood $V$ of $f(x)$ and a subnet of $\{f(x_\alpha)\}$ (which by relabeling we also denote by $\{f(x_\alpha)\}$ ) satisfying $f(x_\alpha)\not\in V$ for all $\alpha$. The compactness of Y guarantees that$\{f(x_\alpha)\}$ has a convergent subnet, which we again denote by $\{f(x_\alpha)\}$, so we may assume $f(x_\alpha)\to y$ for some $y$ in $Y$. Thus $(x_\alpha, f(x_\alpha))$ is a net in $X\times Y$ converging to $(x,y)$. The closedness of graph implies that $f(x)=y$, which contradict the condition that $f(x_\alpha)\not\in V$ for all $\alpha$.

On the other hand, suppose that $f$ is continuous and $Y$ is Hausdorff. and $(x_\alpha,f(x_\alpha))$ is a net converging to $(x,y)$. Since $f$ is continuous, we have that $f(x)=f(\lim x_\alpha)=\lim f(x_\alpha)$. On the other hand, $f(x_\alpha)\to y$. Because $Y$ is Hausdorff, $f(x)=y$.

The compactness is critical: Let $f:[0,\infty)\to [0,\infty)$ given by $f(0)=0$ and $f(x)=\frac{1}{x}$ for any $x\neq 0$. Then the graph of $f$ is closed but it is not continuous.