TITLE: Graph of a continuous function is closed
QUESTION [7 upvotes]: Let $f: \mathbb{R} \to \mathbb{R}$ be continuous. Then $G = \{ (x, f(x) ) : x \in \mathbb{R} \} $ is a closed set.
My try: Suppose $(z_n) =  (x_n, f(x_n) ) $ is sequence in $G$ with limit $(x,y)$. We must show $(x,y) \in G$. Since $x_n \to x$ and since $f$ is continuous, then we must have that $f(x_n) \to f(x) $. Since limits are unique. Then $y = f(x) $. Is this enough to conlude that $(x,y) \in G $ ? Hence showing $G$ is closed ?
thanks

REPLY [6 votes]: Let $\{(x_n, f(x_n))\}_{n=1}^{\infty}$ be a convergent sequence in $G$, say $(x_n, f(x_n)) \to (x,y)$.  So $x_n \to x$.  So $f(x_n) \to f(x)$.  So $f(x) = y$, and so $(x_n, f(x_n)) \to (x, f(x)) \in G$.  So $G$ is closed.