Let $a \in D$, and let $\epsilon > 0$ be arbitrary. Then $f^{-1}(B_{\epsilon}(f(a))$ is open and contains $a$; thus by hypothesis there is some $\delta > 0$ such that $B_{\delta}(a) \subseteq f^{-1}(B_{\epsilon}(f(a))$. But then we see that $f(B_{\delta}(a)) \subseteq B_{\epsilon}(f(a)$. To put this differently, given arbitrary $\epsilon > 0$ we have found $\delta > 0$ such that
$$ |a-z|< \delta \Rightarrow |f(z) - f(a)|< \epsilon.$$
So $f$ is continuous as $a$. Since $a \in D$ was arbitrary we can conclude that $f$ is continuous.
Proof of converse Now let's suppose that $f:D \rightarrow \mathbb{C}$ is continuous, and let $U \subseteq \mathbb{C}$ be an open set. We need to show that $f^{-1}(U)$ is open in $D$. Let $z \in f^{-1}(U)$. Then $f(z) \in U$, and by openness of $U \ \ \exists \epsilon>0$ such that $B_{\epsilon}(f(z)) \subseteq U$. By continuity of $f \ \ \exists \delta > 0$ such that $f(B_{\delta}^D(z)) \subseteq B_{\epsilon}(f(z))$. But then
$$ B_{\delta}^D(z) \subseteq f^{-1}( B_{\epsilon}(f(z))) \subseteq f^{-1}(U). $$
This suffices to show that $f^{-1}(U)$ is open in $D$.