A function is continuous if its graph is closed Any help with the following problem:
Prove that if a function $f: \mathbb{R}\rightarrow \mathbb{R}$ is bounded and its graph is a closed subset of $\mathbb{R}^{2}$, then $f$ is continuous.
 A: There is a useful theorem due to Kuratowski: if $C$ is compact and $X$ is any space, then
the projection $\pi: C \times X \rightarrow X$ defined by $\pi(x,y) = y$ is a closed (and continuous, of course) function. See here for a short proof.
If $f$ is bounded let $C$ be a compact interval with $f[X] \subset C$.
The graph $\Gamma =\{(x, f(x)) \mid x \in \mathbb{R} \}$ of $f$ is a subset of $\mathbb{R} \times C$ by assumption.
If now $K$ is a closed subset of $C$, then note that we have 
$$f^{-1}[K] = \pi[ \Gamma \cap (\mathbb{R} \times K) ]$$
(as $x \in f^{-1}[K]$ then $f(x) \in K$ and $(x, f(x))$ is in $\Gamma$ and in $\mathbb{R} \times K$ and $x$ is its image under $\pi$, while if $x = \pi(x,y)$ for $y \in \Gamma \cap \mathbb{R} \times K$ we know $y \in K$ and $y = f(x)$ to be on $\Gamma$, so $x \in f^{-1}[K]$)
Also, as $\pi$ is a closed map and the set we take an image of is closed in $\mathbb{R} \times C$, $f^{-1}[K]$ is closed in $\mathbb{R}$ for all closed subsets $K$ of $C$, so $f$ is a continuous map from $\mathbb{R}$ to $C$ and thus to $\mathbb{R}$ as well.
Note that the fact that we use $\mathbb{R}$ is irrelevant, all we need is that the image of $f$ is contained in a compact set in the codomain, and there are no conditions on the domain. 
The condition is needed because of the example $f(x) = \frac{1}{x}$ for $ x\neq 0$ and $f(0)= 0$ which has a closed graph but is not continuous, and $f$ is not bounded. 
A: Interesting question; I haven't seen it before, so here's my stab at it.
It's clear that the boundedness is needed, because otherwise we have the counterexample:
$f(x) = \begin{cases}
0 & \text{if } x = n\pi \\
\tan(x) & \text{otherwise}
\end{cases}$
So we're given that $f$ is bounded and its graph, which I'll call $G$, is a closed subset of $\mathbb{R}^2$.
In order to show that it's continuous, we can show any one of a list of equivalent conditions, including the inverse image of an open set is open, or the inverse image of a closed set is closed. But $f^{-1}(S)$, for $S \subset \mathbb{R}$, is just the projection of $(\mathbb{R} \times S) \cap G$ onto the $x$-axis.
If you utilize the fact that $G \subset \mathbb{R} \times I$, where $I$ is a sufficiently large closed interval, and consider $f^{-1}(C)$, $C$ a closed subset of $I$, I believe compactness is on your side to show that $f^{-1}(C)$ contains all of its limit points. See if you can work out the details from there.
A: HINT: Try proving the contrapositive, namely

If $f: \mathbb{R} \rightarrow \mathbb{R}$ has a point of discontinuity, then $f$ is either unbounded OR its graph is not a closed subset of $\mathbb{R}^2$.

A common way to deal with "OR" in a conclusion is to break the proof into two cases. First, suppose $f$ is unbounded. Since this is one of the two conclusions we hope to draw, we're already done! In the other case, we can assume $f$ is bounded and hope to conclude that $f$ is not a closed subset of $\mathbb{R}^2$. In other words, we can transform the original problem into this one:

If $f: \mathbb{R} \rightarrow \mathbb{R}$ has a point of discontinuity AND $f$ is bounded, then $f$ is not a closed subset of $\mathbb{R}^2$.

A: Alternative to the answers already presented, one might use sequences. 
Without giving away everything, suppose $x_n \rightarrow x$, and consider the the sequence $f_n:=f(x_n)$. If any subsequence $f_{n_k}$ of $f_n$ converges, the only candidate for it to converge to is $f(x)$ by the closedness of the graph. Considering $f_n$ is bounded, what can be said about $\limsup f_n$ and $\liminf f_n$?
