Let $A \subset \mathbb{R}^n$ a compact and $f : A \to \mathbb{R}^m$ a continuous function. Let the graph of $f$ $$Gr(f) = \{(x,f(x) : x \in A)\}.$$ Show that $Gr(f)$ is compact.
My proof :
As $A$ is compact et $f$ a continuous function, then f(A) is also compact.
The graph of $f$ is only the cartisian product of $A$ et $f(A)$ (by construction of $Gr(f)$); i.e. $$Gr(f) = A \times f(A)$$. The production of compact spaces is also compact.
Conclusion : $Gr(f)$ is compact.
Is there a hole in my proof? If yes, could anyone is able to give me a hint?
Note that
$$Gr(f) = \{ (x, f(x)) : x\in A\}$$
and
$$A\times f(A) = \{ (x, f(y)): x, y \in A\}$$
So $A\times f(A)$ is strictly bigger in general.
To show that $Gr(f)$ is comapct, you might check directly that $Gr(A)$ is sequential compact: let $(x_n, f(x_n)) \in Gr(f)$ be a sequence. Then compactness of $A$ implies that $x_n \to y \in A$ (taking subsequence if necessary), then try to use the continuity of $f$.