This might be an easy theorem but I am struggling to understand.
I would like to prove that the continuity definition in the metric spaces using $\varepsilon$ and $\delta$ implies that continuity definition in topological space.
The proof goes as follows. Given topological spaces $(X,\tau_X)$ and $(Y,\tau_Y)$ and a continuous function $f:X \to Y$, we first choose an open set $V \in \tau_Y$, so we need to show the pre-image $f^{-1}(V) \in \tau_X$, we choose $x_1 \in f^{-1}(V)$ such that $f(x_1) \in V$, then since the basis of a metric induced topology has its elements as open balls, we have $V = \bigcup_{j \in I}{B_{j}}$ where $B_j = B_\varepsilon(y \in Y)$. So using the definition of the continuity in the metric spaces, $\forall \varepsilon$, $\exists \delta$ such that, $\forall x_2 \in X$, $x_2 \in B_{\delta}(x_1)$ implies $f(x_2) \in B_{\varepsilon}(f(x_1))$, so I understand $f(B_{\delta}(x_1)) \subseteq B_{\varepsilon}(f(x_1))$ where $B_{\varepsilon}(f(x_1)) \subseteq V$ and $B_{\delta}(x_1) \subseteq f^{-1}(V)$, but then I really get stuck for the following part.
$f^{-1}(V) = f^{-1}(\bigcup_{j \in I}{B_{j}}) = \bigcup_{j \in I}{f^{-1}(B_j) \in \tau_X}$. I know that $B_j \in \tau_Y$ as it is an element of the basis for $\tau_Y$, but how on earth do I know that $f^{-1}(B_j) \in \tau_X$ from here? I spent hours and hours and couldn't figure it out. Could anyone kindly explain without resorting to some neighbourhood concepts or other theorems?
The problem seems to be this: if $B$ is an open ball (in $Y$) with radius $\varepsilon$, why is $f^{-1}(B)$ an open subset of $X$?
Take $x\in f^{-1}(B)$. Then $f(x)=y'$, for some $y'\in B$. Then there is a $\varepsilon'>0$ such that $B_{\varepsilon'}(y')\subset B$ (take $\varepsilon'=\varepsilon-d(y,y')$). By continuity, there is a $\delta(x)>0$ such that $$B_{\delta(x)}(x)\subset f^{-1}\bigl(B_{\varepsilon'(y')}\bigr)\subset f^{-1}(B).$$Therefore$$f^{-1}(B)=\bigcup_{x\in f^{-1}(B)}\{x\}\subset\bigcup_{x\in f^{-1}(B)}B_{\delta(x)}(x)\subset f^{-1}(B)$$and so$$f^{-1}(B)=\bigcup_{x\in f^{-1}(B)}B_{\delta(x)}(x)\in\tau_X.$$