Prove $f :\mathbb{R} \to \mathbb{R}$ is continuous iff for every open set $U \subset \mathbb{R}$, the preimage is open.

continuityfunctions

I am trying to prove that a function $f :\mathbb{R} \to \mathbb{R}$ is continuous iff for every open set $U \subset \mathbb{R}$, the preimage $f^{-1}(U) = \{x\in\mathbb{R}|f(x)\in U\}$ is open.

To prove the backwards implication I have that$$\forall x\in f^{-1}(U), \exists\delta>0, (x-\delta,x+\delta)\subset f^{-1}(U)$$^ from the definition of an open set. $$(x-\delta,x+\delta)\subset f^{-1}(U)$$ and then applying $f$ $$(f(x+\delta),f(x-\delta))\subset U$$

So $f$ hits all the points in that interval, can I then say it is continuous over that interval? Or is my method of proof completely wrong.

Best Answer

Suppose the set $f^{-1}(U)=\{x\in\mathbb{R}:f(x)\in U\}$ is an open set. We want to see that $f$ is a continuous function, that is, for all $\varepsilon>0$ and $a\in\mathbb{R}$ there exists $\delta>0$ such that $|x-a|<\delta$ implies that $|f(x)-f(a)|<\varepsilon$.

Let $a\in\mathbb{R}$ and $\varepsilon>0$. Consider the set $U_{\varepsilon}=(f(a)-\varepsilon,f(a)+\varepsilon)$, which is open. Then $f^{-1}(U_{\varepsilon})=\{x\in\mathbb{R}:f(x)\in(f(a)-\varepsilon,f(a)+\varepsilon)\}$ is open on $\mathbb{R}$. Notice that $a\in f^{-1}(U_{\varepsilon})$. Thus, there exists $\delta$ such that $(a-\delta,a+\delta)\subset f^{-1}(U_{\varepsilon})$.

If $x\in (a-\delta,a+\delta)$ then $|x-a|<\delta$. Also, this implies that $x\in f^{-1}(U_{\varepsilon})$, which means that $f(x)\in(f(a)-\varepsilon,f(a)+\varepsilon)$; rewriting, $|f(x)-f(a)|<\varepsilon$. Therefore $f$ is continuous.