Problem: Let $X$ and $Y$ be two topological spaces and $f: X \rightarrow Y$ is a continuous function. Recall that the
graph $G$ of $f$ is the subset
\[
G = \left\{ (x, f(x)) : x \in X \right\} \subseteq X \times Y.
\]
Then $G$ is a topological space as a subspace of $X \times Y$ with the product topology. Show that $X$ is homeomorphic to $G$.
Solution: Consider the map
\[
\phi : X \to G, \quad x \mapsto (x, f(x)).
\]
Note that $\phi (x) = (Id \times f)(x,x)$, where $Id$ is the identity function on $X$. Since $Id$ and $f$ both are continuous functions, their product will be continuous and hence $\phi $ is continuous. Also,
\begin{align*}
h(x) = h(y) & \implies (x, f(x)) = (y, f(y)) \implies x = y.
\end{align*}
Thus, $h$ is injective. Now for the surjectivity, for any $(x,f(x)) \in G$, $x \in X$ and hence $\phi (x) = (x,f(x))$. Thus $\phi $ is a bijective continuous function from $X$ to $G$. Also, the function
\[
\psi : G \to X, (x,f(x)) \mapsto x
\]
is clearly continuous
Consider
\begin{align*}
& \phi \circ \psi (x,f(x)) = \phi (x) = (x,f(x)) = Id_{G} \\
& \psi \circ \phi (x) = \psi (x, f(x)) = x = Id_{X}.
\end{align*}
Thus, $\psi $ is the continuous inverse of $\phi $ and hence $G$ is homeomorphic to $X$.