Continuous functions and homeomorphisms

Let $\displaystyle X$ and $\displaystyle Y$ be topological spaces and $\displaystyle f : X \longrightarrow Y$ a function. The graph of $\displaystyle f$ is the set $\displaystyle G_f = \{(x,f(x)) : x \in X\}$.

Prove that $\displaystyle f$ is continuous if and only if the function $\displaystyle \Phi : X \longrightarrow G_f$ given by $\displaystyle \Phi(x) = (x,f(x))$ is a homeomorphism where $\displaystyle G_f$ has the topology relative to the product topology $\displaystyle X \times Y$.