Proving a function is continous only if a set is open Prove that a function from $\mathbb{R}$ to $\mathbb{R}$ is continuous if and only if the inverse image every open set is open.
Definition: A set is open if it contains all its interior points.
Proof: Let $f$ be continuous, then $\forall a,\forall \epsilon > 0$, there exists a $\delta > 0$ such that $$|x - a| < \delta \Rightarrow |f(x) - f(a)| < \epsilon$$ Let $O$ be open to show $f^{-1}(O) = \{ x:f(x)\in O \}$ is open. Let $a\in f^{-1}(O) \Rightarrow f(a)\in O$. Since $O$ is open, there exists $\epsilon > 0$ such that $N(f(a),\epsilon)\subset O$. But, $f$ is continuous at $a$, so given this $\epsilon$,there exists a $\delta > 0$ such that $$|x - a| < \delta \Rightarrow |f(x) - f(a)| < \epsilon$$ Moreover, $x\in N(a,\epsilon) \Rightarrow f(x)\in N(f(a),\epsilon)$. This last is contained in $O$, so  $N(a,\epsilon)\subset f^{-1}(O)$. Hence, $a$ is an interior point of $f^{-1}(O)$. This is true for all $a$, so $f^{-1}(O)$ is open.
I am not sure if this is right any suggestions would be greatly appreciated. 


Moreover, $x\in N(a,\epsilon) \Rightarrow x\in N(f(a),\epsilon)$. This last is contained in $O$, so  $N(a,\epsilon)\subset f^{-1}(O)$. Hence, $a$ is an interior point of $f^{-1}(O)$. This is true for all $a$, so $f^{-1}(O)$ is open.

I suppose you mean $x\in N(a,\delta)\Rightarrow f(x)\in N(f(a),\epsilon)$. Then your proof is correct.
Also ...

Definition: A set is open if it contains all its interior points.

Here it should read "A set is open if each of its points is an interior point". I assume this is what you mean as it is exactly what you are showing in your proof.
What about the reverse implication? Or did you only need help for this direction?
