Is function continuous if preimage of every open interval is open

continuitygeneral-topology

We define $f: X \to \mathbb{R}$ such that for every open interval $(a,b)$ its preimage $f^{-1}\left((a,b)\right)$ is open.

Does it imply that f is continuous?

I know the opposite is not true (e.g for $f(x) = x^{2}$ we have $f^{-1}\left((1,4\right)) = (-2, -1) \cup (1,2) $ which is not an open interval (since any number between -1 and 1 is not there).

It looks like this question has already been answered here – Function in which every inverse image of open "interval" is open interval but not continuous. – but unfortunately I am unfamiliar with bases and could not get a good grasp of the answer.

Is there an easy way to prove it without that term?

Best Answer

Yes. Because preimages work nicely with set operations.

If you take any open set $V\subset \mathbb R$, you can write $V=\bigcup_j(a_j,b_j)$ (this is very easy to prove: for every point in $V$ there is an interval that contains the point and is contained in $V$). Thus $$ f^{-1}(V)=f^{-1}(\bigcup_j(a_j,b_j))=\bigcup_j f^{-1}((a_j,b_j)) $$ is a union of open sets so open. So $f$ is continuous.