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.

  • 1
    $\begingroup$ 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. $\endgroup$
    – student
    Jan 12, 2012 at 18:12
  • $\begingroup$ @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]$ $\endgroup$
    – kahen
    Jan 12, 2012 at 18:19
  • $\begingroup$ @kahen: the norm on $C^1[0, 1]$ should be just $\|f\|$ (the supremum norm) for this example. $\endgroup$
    – student
    Jan 12, 2012 at 18:21
  • 3
    $\begingroup$ Your Banach space example needs the hypothesis of "linear" also. $\endgroup$
    – GEdgar
    Jan 12, 2012 at 18:22

2 Answers 2


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

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

  • $\begingroup$ @Kamil Here's a proof. $\endgroup$ Aug 22, 2016 at 10:36
  • 2
    $\begingroup$ 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). :) $\endgroup$ Aug 22, 2016 at 10:44
  • $\begingroup$ @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$). $\endgroup$ Aug 22, 2016 at 11:58
  • 1
    $\begingroup$ 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. ;) $\endgroup$ Aug 22, 2016 at 12:07

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .