If $f$ is defined on $R$ and $f(K)$ is compact whenever $K$ is compact, then is $f$ continuous on $[a,b]$?

924 Views Asked by At

If $f$ is defined on $R$ and $f(K)$ is compact whenever $K$ is compact, then is $f$ continuous on $[a,b]$?

I know that if $f : K → R$ is continuous and $K \in R$ is compact, then $f(K)$ is compact, but does is the converse of this true?

Or in other words does compactness of $f(K)$ imply continuity?