[Math] A converse of sorts to the intermediate value theorem, with an additional property

analysisreal-analysis

I need to solve the following problem:

Suppose $f$ has the intermediate value property, i.e. if $f(a)<c<f(b)$, then there exists a value $d$ between $a$ and $b$ for which $f(d)=c$, and also has the additional property that $f^{-1}(a)$ is closed for every $a$ in a dense subset of $\mathbb{R}$, then $f$ is continuous.

I can see plenty of counterexamples when the second property is not added, but I can't seem to bridge the gap between adding the property and proving $f$ is continuous. I can't get there either directly or by contradiction, because the additional property doesn't seem directly relevant to the property of continuity, so could anyone please tell me how to go about doing this? Thanks!

Best Answer

Suppose $x_n$ tends to $x$, but $f(x_n)$ does not tend to $f(x)$. Then there is a neighbourhood $(f(x)-\epsilon, f(x)+\epsilon)$ which $f(x_n)$ misses infinitely often. WLOG $f(x_n)>f(x)+\epsilon$ for infinitely many $n$. Hence $f(y)>f(x)+\epsilon$ for $y$ arbitrarily close to $x$. But then, for any $a$ in $(f(x),f(x)+\epsilon)$, the intermediate value property tells us that $f$ takes the value $a$ at points arbitrarily close to $x$. By our other assumption, at least one such $a$ has closed preimage. Contradiction.

Related Question