# Prove that $f: \mathbb{R} \rightarrow \mathbb{R}$ is continuous iff $f^{-1}(O)$ is open for each open set $O$

1. How would you proceed in the below, or have I led myself to a dead-end?

• Let $$O$$ be an open set from $$\mathbb{R}$$. $$O \subset \mathbb{R}$$
• Let $$D \subseteq \mathbb{R}$$, be the domain of $$f$$. i.e. $$f : D \rightarrow \mathbb{R}$$. For notation ease.
• Then $$f^{-1}(O) = \left\{ d \in D | f(d) \in O \right\}$$
• $$f^{-1}(O)$$ is open. Proof.
• The above implies: $$\forall x \in f^{-1}(O)$$, there is a $$r > 0$$ s.t. $$\left\{ y \in \mathbb{R} | |y-x| < r \right\} \subset f^{-1}(O)$$

Now the above looks very similar to the $$\epsilon-\delta$$ definition of the continuity, but the statement is about the domain of function $$f$$. So I am stuck.

1. How come there is a counter-example to this proof (I must be understanding it incorrectly)?

I know there is this question. But I am asking about my steps in 1.

• If $f:\Bbb R\to\Bbb R$ is a function, then its domain is $\Bbb R$. – Lord Shark the Unknown Apr 22 at 11:56
• I wanted to write $d \in D$ in the definition of $f^{-1}(O)$ for better clarity. – i squared - Keep it Real Apr 22 at 11:58
• There is no counter-example, there are examples of continuous functions that are not open. – Peter Melech Apr 22 at 12:00
• @PeterMelech got it, thanks – i squared - Keep it Real Apr 22 at 12:00
• You seem to be confusing open functions with continuous functions. $f$ is continuous iff the preimage of open sets is open, and $f$ is open iff the image of open sets is open. The counterexample shows that $f$ continuous doesn't imply $f$ open. – Yagger Apr 22 at 13:23