# If $I$ is an interval of $\Bbb{R}$, $f: I \to \Bbb{R}$ connected and $\forall y \in I\; f^{-1}(\{y\})$ closed in $I$ then $f$ is continuous

I have found this theorem in a calculus book

We say a function $$f: I \to \Bbb{R}$$, $$I$$ interval of $$\Bbb{R}$$ is connected if $$\forall J \subseteq I$$, with $$J$$ interval, $$f(J)$$ is an interval. Prove that if $$f$$ is connected and if $$\forall y \in \Bbb{R} \, f^{-1}(\{y\})$$ is a closed set in the relative topology of $$I$$, then $$f$$ is continuous.

I have no idea where I can start, can you give me some hints?

• To the OP: I would recommend adding the topology tag. This is a question that seems more suited toward a topological answer than a calculus-type of answer. (I have ideas from topology on how to approach this problem, but I personally am not sure how I’d be using strictly calculus topics to approach this problem. Hence my first question; you could be taking the two courses concurrently and mixed up the titles.) Nov 14, 2018 at 17:10
• @Clayton if you can solve it using topology it's good too. Perhaps the problem is that I cannot distinguish between calculus and mathematical analysis since in my main language the latter is used to indicate both; but having seen some foreign books of both, I'm quite confident the one I use is a calculus book. I'm sorry for any misunderstandings due to this semantical problem... Nov 14, 2018 at 17:10
• Note: anyway, I'm still a student and I've not begun studying mathematical analysis yet... Nov 14, 2018 at 17:12
• Can you state a few of the topological definitions/theorems that you have available? I assume you know the “inverse image of an open set is open” characterization for continuous functions? Nov 14, 2018 at 17:16
• @Clayton I know that $f: D \rightarrow \Bbb{R}$ is continuous $\iff$ $\forall X,\; \text{X open set of } \Bbb{R} \; f^{-1}(X) = f^\leftarrow(X)$ is opened in the relative topology of $D$ and that holds also if we replace "opened" with "closed". Anyway, I have some elementary general topology knowledge and the book states some of them (actually, three chapters of it are dedicated to topology...). Nov 14, 2018 at 19:27

For $$x \in I$$ let $$I_n(x) = I \cap (x - \frac{1}{n},x + \frac{1}{n})$$. This is an open neighborhood of $$x$$ in $$I$$. We have $$(*) \phantom{xx} \bigcap_{n=1}^\infty f(I_n(x)) = \{ f(x) \} .$$ "$$\supset$$" is trivial. To verify "$$\subset$$", let $$y \in \bigcap_{n=1}^\infty f(I_n(x))$$. Then there exist $$x_n \in I_n(x)$$ such that $$f(x_n) = y$$. Obviously $$x_n \to x$$. Since $$f^{-1}(y)$$ is closed in $$I$$ , we see that $$x \in f^{-1}(y)$$, i.e. $$f(x) = y$$.
Let $$\varepsilon > 0$$. Since $$I_n(x)$$ is an interval, also $$J_n = f(I_n(x))$$ is an interval. We have $$J_n = \langle a_n,b_n \rangle$$, where $$\langle a_n,b_n \rangle$$ stands for an open, half-open or closed interval such that $$a_n \le f(x) \le b_n$$. $$a_n = -\infty$$, $$b_n = \infty$$ is allowed. The sequence $$(a_n)$$ is increasing, the sequence $$(b_n)$$ decreasing. But $$(*)$$ shows that $$a_n, b_n \to f(x)$$, hence $$f(I_n(x)) = J_n \subset (f(x)- \varepsilon, f(x)+ \varepsilon)$$ for sufficiently large $$n$$. This means that $$f$$ is continuous.