# Discontinuous functions with closed graphs

I tried looking up a question regarding graphs of continuous functions on this site, but all the ones I found consider functions from $\mathbb{R}$ into $\mathbb{R}$. I have been pondering the following question: given a general topological spaces $X, Y$, and a function $f: X\to Y$, when does $Graph(f)$ closed in $X\times Y$ imply that $f$ is continuous. By the closed graph theorem, this is true whenever $X$ and $Y$ are both Banach spaces.

Also, it is fairly easy to prove that whenever $Y$ is a Hausdorff space and $f$ is continuous, then $Graph(f)$ is closed, but I do not think that the converse is true, so I am trying to find an example where $X$ is some topological space, $Y$ a Hausdorff space, $f: X\to Y$ a function with a closed graph in $X\times Y$, but who fails to be continuous. As of yet I have not been able to find such a counterexample, partially because I have no clue where to look for such a counterexample. I would really appreciate getting some directions to go in.

• Hint: consider the derivative as a function of $C^1[0, 1]$ to $C^0[0, 1]$. This is a linear, unbounded function (hence not continuous), but you can show that its graph is closed. Jan 12, 2012 at 18:12
• @Leandro: what norm are you using on $C^1[0,1]$? If it's $\lVert f'\rVert + \lVert f\rVert$, then $(f_n)$ converges in $C^1[0,1]$ iff both $(f_n)$ and $(f_n')$ converge uniformly on $[0,1]$ Jan 12, 2012 at 18:19
• @kahen: the norm on $C^1[0, 1]$ should be just $\|f\|$ (the supremum norm) for this example. Jan 12, 2012 at 18:21
• Your Banach space example needs the hypothesis of "linear" also. Jan 12, 2012 at 18:22

$f\colon\mathbb{R}\to\mathbb{R}$ defined by $$f(x)=\frac1x\quad\text{if}\quad x\ne0,\quad f(0)=0.$$

• What if we want $X$ to be compact? ie, I need a discontinuous function $f:X \longrightarrow \mathbb{R}$, whose graph is closed. Nov 17, 2015 at 16:55
• Ohh.. We just have to take the same function on $[-1,1]$.. Nov 17, 2015 at 17:03
• @JansonA.J $X=[0,1]$, same $f$. Nov 17, 2015 at 17:05
• @JuliánAguirre, how do you know the graph is closed? Can you prove that? Aug 1, 2016 at 8:41
• @theatomicdude Because the question asks for $f$ defined on $\mathbb{R}$. Jan 24, 2017 at 9:33

I'd like to answer the comment about why the graph is closed (particularly as it also took me a while to see it).

To see that the graph of $f\colon\mathbb{R}\to\mathbb{R}$ defined by $$f(x)=\frac1x\quad\text{if}\quad x\ne0,\quad f(0)=0.$$ is closed consider the equivalent definition of a closed graph in a metric space. $G(f)$ is closed if whenever $(x_n) \to x$ and $(f(x_n)) \to y$ then $y = f(x)$. (This follows since in a metric space closure is equivalent to sequential closure and convergence in the product space is equivalent to convergence of the components)

Now for $(x_n) \to 0$ then $(f(x_n))$ is not convergent so $(x_n) \to x$ and $(f(x_n)) \to y$ is not satisfied, while for every other sequence $(x_n) \to x \ne 0$ then $(f(x_n)) \to f(x)$.

So it is true that whenever $(x_n) \to x$ and $(f(x_n)) \to y$ then $y = f(x)$ and therefore $G(f)$ is closed.

• @Kamil Here's a proof. Aug 22, 2016 at 10:36
• Alternatively: The set in question is a finite union of closed sets: The origin (a singleton) and the level set $xy = 1$ (which is clearly closed since $f(x, y) = xy$ is continuous). :) Aug 22, 2016 at 10:44
• @AndrewD.Hwang. Thanks. I'm a little confused about $f(x, y) = xy = 1$ since it isn't defined on all of $X \times Y$, i.e. not defined at $x = 0$ (or at $y = 0$). Aug 22, 2016 at 11:58
• The function $f(x, y) = xy$ is a quadratic polynomial in two variables, hence defined (and continuous) everywhere. You're perfectly correct that the level set $f(x, y) = 1$ doesn't touch the coordinate axes, but that's not the same as saying $f$ is undefined along the axes. ;) Aug 22, 2016 at 12:07