Possible Duplicate:
If the graph of a function $f: A \rightarrow \mathbb R$ is compact, is $f$ continuous where $A$ is a compact metric space?
I was wondering about whether I can use the proposition above in the following manner
So if I have two metric spaces, say A and B and $f: A\rightarrow B$ and the graph of $f$, say $G$ is compact. Then I know that $G\subseteq A \times f(A) \text{ where $f(B)$} \subseteq B$ is compact. Since $G$ is compact, for every sequence, I have a convergent subsequence $(a_{n_k},b_{n_k})$ that converges to an ordered pair $(a,b)$ in $G$.
Now $(a_{n_k},ba_{n_k})$ converges iff $a_{n_k} \rightarrow a \in A$ and $b{n_k} \rightarrow b \in f(A)\subseteq B$. $(a_{n_k})$ is a convergent subsequence of $(a_n)$ in $A$. So $A$ is compact. Similarly $f(A)$ is compact. Since the image of $f$ is compact and the domain is compact, $f$ is continuous.
Does this make sense?