$f\colon\mathbb{R}\to\mathbb{R}$ is continuous if and only if for every open set $A$ in $\mathbb{R}$ we have $f^{-1}(A)$ open in $\mathbb{R}$ I would like some feedback and corrections to my proof below that $f\colon\mathbb{R}\to\mathbb{R}$ is continuous if and only if for every open set $A$ in $\mathbb{R}$ we have $f^{-1}(A)$ open in $\mathbb{R}$, using $\varepsilon\text{-}\delta$ definition of continuity.
($\Rightarrow$). If $f$ is continuous, then for all $a\in\mathbb{R}$ we have that for all $\varepsilon>0$ there is a $\delta>0$ such that for all $x\in X$ with $\left|x-a\right|<\delta$ this is going to imply that $\left|f(x)-f(a)\right|<\varepsilon$.
Take an open set $A\subset f[\mathbb{R}]\subset \mathbb{R}$ (I'm not sure if it's necessary to take it as subset of $f[\mathbb{R}]$). For any $f(a)\in A$, because $f$ is continuous, we can choose any $\varepsilon>0$, so we do it by choosing $\varepsilon_{f(a)}>0$ such that $(f(a)-\varepsilon,f(a)+\varepsilon)\subset A$, and this is possible because $A$ is open by hypothesis.
As $f$ is continuous, this $\varepsilon_{f(a)}>0$ will gives us a $\delta_{a}>0$ such that all $x\in \mathbb{R}$ that are within a distance $\delta_a$ from $a$ will have their image $f(x)$ within a distance $\varepsilon_{f(a)}$ from $f(a)$. That is, we are going to have an open interval $(a-\delta_a,a+\delta_a)$, and because all of the $x\in\mathbb{R}$ inside of this interval have their image $f(x)\in A$, this interval $(a-\delta_a,a+\delta_a)$ is a subset of $f^{-1}(A)$.
If we follow this for all $f(a)\in A$, we are going to end up with an open interval with center $a$ and radius $\delta_a$ for each $a\in f^{-1}(A)$, so $f^{-1}(A)$ is open.
($\Leftarrow$). We have that for every open set $A$ of $\mathbb{R}$ we have $f^{-1}(A)$ open in $\mathbb{R}$.
As $A$ is open in $\mathbb{R}$, for all elements $f(a)\in A$ there is an $\varepsilon_{f(a)}>0$ such that $(f(a)-\varepsilon_{f(a)},f(a)+\varepsilon_{f(a)})$ is a subset of $A$.
So we can obtain an $a\in f^{-1}[(f(a)-\varepsilon_{f(a)},f(a)+\varepsilon_{f(a)})]$. And because $f^{-1}[(f(a)-\varepsilon_{f(a)},f(a)+\varepsilon_{f(a)})]\subset f^{-1}(A)$ and $f^{-1}(A)$ is open, we choose a $\delta_a>0$ such that $(a-\delta_a,a+\delta_a)\subset f^{-1}[(f(a)-\varepsilon_{f(a)},f(a)+\varepsilon_{f(a)})]$.
Therefore, we have that $f[(a-\delta_a,a+\delta_a)]\subset (f(a)-\varepsilon_{f(a)},f(a)+\varepsilon_{f(a)})$ and we conclude that $f$ is continuous.
 A: Before I get in there and deliver all the negative feedback, I'd like to say that you have a firm grasp on the logic behind this proof, and none of the issues I'm going to point out are serious. If I were marking this as an assignment in undergraduate maths, I would award it full marks.

Take an open set $A \subset f[\Bbb{R}] \subset \Bbb{R}$ (I'm not sure if it's necessary to take it as subset of $f[\Bbb{R}]$).

It's not necessary, and indeed (depending a little on how this is interpreted) problematically restrictive. For example, if $f$ is the indicator function of the rationals, then $f(\Bbb{R}) = \{0, 1\}$. There are no open subsets of $\Bbb{R}$ contained in this set except the empty set, and $f^{-1}(\emptyset) = \emptyset$, which is open! So, according to this condition, $f$ should be continuous, when in reality, it is discontinuous everywhere.
You should only assume $A \subset \Bbb{R}$ is open. It doesn't matter if $A$ contains points that are not in $f(\Bbb{R})$ (though these points will not contribute anything to $f^{-1}(A)$).
The rest of the $\implies$ direction is good, as you don't use the assumption that $A \subseteq f(\Bbb{R})$. I would caution you to be a little more consistent with your $\varepsilon$ notation. Are you denoting $\varepsilon$, or $\varepsilon_{f(a)}$? Stick with one or the other, as either one would be acceptable.
For the $\impliedby$ direction, there's no need to talk about an arbitrary open $A$. Specifically, where you say

As $A$ is open in $\Bbb{R}$...

you haven't actually defined an $A$ to speak of.
All you need to do is show $f$ is continuous at an arbitrary $a \in \Bbb{R}$: fix arbitrary $\varepsilon > 0$, and consider $f^{-1}(f(a) - \varepsilon, f(a) + \varepsilon)$. Use the fact that this is open and contains $a$, in much the same way that you have. That is, there's no need to consider an arbitrary open $A$, when you have a very specific open set $(f(a) - \varepsilon, f(a) + \varepsilon)$.
