I encountered the fact that ' to prove function $f$ on metric space $X$ is continuous, it is enough to prove $f$ is continuous on every compact subspace $X$'.
I thought this fact is obvious because ' In metric space, notion of continuous is equivalent to sequential continuous, so it is enough to prove $f$ is continuous at every point of $X$, but every one point in $X$ is compact, so the fact follows.
Is this correct?
P.S.
Some websites reads like this, 'If $x_n\to x$, then the set $\{x\} \cup \{ x_n : n \in \mathbb{N}\}$ is compact', so the fact follows.But I think above explanation is enough.