Topological property of continuous function 

$f: D \rightarrow \mathbb{R}$ (when $D \subseteq R$) is continuous function if and only if for all open set $G$, $f^{-1}(G)$ is also open set on $D$.


I want to prove the $\Rightarrow$ of this theorem. The following is the proof in my textbook.
Let $f$ be a continuous function on $D$ and $G$ be an open set, $H:=f^{-1}(G)$. If $H\cap D = \phi$, it is done. If $H\cap D \not = \phi$, let $a \in H \cap D$, and $b:=f(a)$, then $b\in G$. Since $G$ is open set, there exists an open ball $B_\epsilon(b) \subseteq G$ radius of which is $\epsilon>0$. By the assumption $f$ is continuous, $\exists \delta : \forall x \in B_\delta (a) \cap D \rightarrow |f(x) - f(a)| <\epsilon$. This means that $B_\delta (a) \subseteq f^{-1}(G)$, so that $f^{-1}(G)$ is open set.
I don't understand the bold part of the proof that it derive $B_\delta (a) \subseteq f^{-1}(G)$.
I haven't studied metric space and general topology, so explain me more easily.
 A: The sentence $\exists \delta : \forall x \in B_\delta (a) \cap D \rightarrow |f(x) - f(a)| <\epsilon$ says that for any $x \in B_\delta(a)\cap D$, $f(x)$ is an element of $B_\epsilon(b)$. But $B_\epsilon(b)$ was chosen to be inside $G$, so we have $f(x) \in G$. That is exactly the same as saying that $x \in f^{-1}(G)$.
So any $x$ that is inside $B_\delta(a)\cap D$ is also inside $f^{-1}(G)$, and therefore  $B_\delta(a)\cap D \subseteq f^{-1}(G)$. The set $B_\delta(a)\cap D$ might not be open in $R$, but it is an open $\delta$-ball in $D$, surrounding our arbitrary $a$, contained in $f^{-1}(G)$, and therefore we're done.
A: I would plead for: "This means that $B_{\delta}(a)\cap D\subseteq f^{-1}(G)$"
Though, if $B_{\delta}(a)$ is immediately defined as subset of $D$ in metric space $D$ then you can also do it with $B_{\delta}(a)$ itself.
If $x\in B_{\delta}(a)\cap D$ then we have $f(x)\in B_{\epsilon}(b)\subseteq G$, right?
Well, the statements $f(x)\in G$ and $x\in f^{-1}(G)$ are equivalent. So we have:
$$x\in B_{\delta}(a)\cap D\implies x\in f^{-1}(G)$$
This comes to the same as: $$B_{\delta}(a)\cap D\subseteq f^{-1}(G)$$
