Question about metric and compactness My question comes up from Exercise 4.6 of Rudin's book. Here's the problem

$f$ is function defined on $E$. Suppose $E$ is compact.
Prove $f$ is continuous on $E$ if and only if its graph, which is set of points $(x,f(x))$ for $x \in E$, is compact.

When I look at the solution pdf, it defines specific metric on cartesian product of $E$ and co-domain of $f$(which is sum of metric on $E$ and metric on co-domain of $f$) and prove the statement. Is it completely fine logic? I think proving under 'specific' metric is not enough for the problem.
 A: The logic is acceptable. The statement of the problem is not. There was a particular thing that Rudin was assuming in stating the problem that he did not explicitly mention.
We are given a map $f: E \to Y$ for some topological metric spaces $E$ and $Y$, with $E$ compact. We are supposed to prove that $f$ is continuous if and only if the set $G = \{(x, f(x))\mid x \in E\}$ is compact.
However, this is clearly going to depend on the topology on $G$, and we are not told what that topology is. For example, if $E = Y = [0,1]$ under the usual metric, and $f(x) = x$ is the identity map, then clearly $f$ is continuous. But suppose we define $$d((e,y),(e',y')) = \begin{cases} 0, & e = e'\text{ and }y = y'\\1, & \text{otherwise}\end{cases}$$
Then $d$ is a metric which induces the discrete topology on $G$. Since $G$ is infinite, the collection $\big\{\{x\}\mid x \in G\big\}$ is an infinite cover of $G$ by open sets without a finite subcover. I.e., $G$ is not compact.
But there is a natural topology to put on $E \times Y$ in this case, which $G$ inherits as a subspace. It is called the product topology, and is so commonly used that people will regularly refer to $U \times V$ and leave to the reader to understand that the product topology is meant. This is what Rudin did - he was assuming that topology because it is just what you do. The particular metric he defined induces the product topology (as does practically any reasonable way of combining the metrics on $E$ and $Y$). 
What he overlooked in writing this exercise is that he was talking to people who have yet to be introduced to the product topology and this convention. And thus he forgot to define the metric to be used in the problem statement.
