Let $f:\mathbb R \to \mathbb R$ be a function such that it carries compact sets to compact sets and $f^{-1}(\{x\})$ is closed for every $x \in \mathbb R$ , then is $f$ continuous ?
(I know that if $f$ is a function on real line having ivt and preimage of every singleton is closed then $f$ is continuous ; also if a function on real line has ivt and carries compact sets to compact sets then $f$ is continuous ; this question is motivated from theses two facts )
Hint: By the Heine-Borel theorem, every compact subset of $\mathbb R$ is closed and bounded. Therefore, f carries closed sets into closed sets.
Claim: A function f from X into Y is continuous if and only if preimages of closed sets in Y are closed in X.
If you can prove this,this will show the answer is yes.