[proofplan]
We prove both implications directly from the definition of continuity and the defining property of a basis. If $f$ is continuous, every open subset of $Y$ has open preimage, so this applies immediately to each basis element. Conversely, if preimages of basis elements are open, then every [open set](/page/Open%20Set) in $Y$ is a union of basis elements, and its preimage is the corresponding union of open subsets of $X$.
[/proofplan]
[step:Use continuity to prove openness of preimages of basis elements]
Assume that $f: X \to Y$ is continuous. By definition of continuity, for every set $V \in \tau_Y$, the preimage $f^{-1}(V)$ belongs to $\tau_X$. Since $\mathcal{B}_Y \subset \tau_Y$, every $B \in \mathcal{B}_Y$ is an open subset of $Y$. Therefore, for every $B \in \mathcal{B}_Y$, we have $f^{-1}(B) \in \tau_X$.
[/step]
[step:Express an arbitrary open set as a union of basis elements]
Assume that $f^{-1}(B) \in \tau_X$ for every $B \in \mathcal{B}_Y$. Let $V \in \tau_Y$ be arbitrary. Since $\mathcal{B}_Y$ is a basis for $\tau_Y$, define the indexing set
\begin{align*}
\mathcal{I}_V := \{B \in \mathcal{B}_Y : B \subset V\}.
\end{align*}
The basis property gives
\begin{align*}
V = \bigcup_{B \in \mathcal{I}_V} B.
\end{align*}
[guided]
Assume that $f^{-1}(B) \in \tau_X$ for every basis element $B \in \mathcal{B}_Y$. To prove that $f$ is continuous, we must start with an arbitrary open set in the codomain and show that its preimage is open in $X$.
Let $V \in \tau_Y$ be arbitrary. Because $\mathcal{B}_Y$ is a basis for $\tau_Y$, every point of the open set $V$ lies in some basis element contained in $V$. We collect exactly those basis elements by defining
\begin{align*}
\mathcal{I}_V := \{B \in \mathcal{B}_Y : B \subset V\}.
\end{align*}
Then the defining property of a basis implies
\begin{align*}
V = \bigcup_{B \in \mathcal{I}_V} B.
\end{align*}
This representation is the central reduction: instead of checking the preimage of an arbitrary open set directly, we rewrite that open set using the basis elements whose preimages are open by hypothesis.
[/guided]
[/step]
[step:Take preimages and use closure of a topology under unions]
Using the set identity from the previous step and the fact that preimages commute with arbitrary unions, we obtain
\begin{align*}
f^{-1}(V)
&= f^{-1}\left(\bigcup_{B \in \mathcal{I}_V} B\right) \\
&= \bigcup_{B \in \mathcal{I}_V} f^{-1}(B).
\end{align*}
For each $B \in \mathcal{I}_V$, we have $B \in \mathcal{B}_Y$, so $f^{-1}(B) \in \tau_X$ by hypothesis. Since $\tau_X$ is closed under arbitrary unions, it follows that
\begin{align*}
f^{-1}(V) \in \tau_X.
\end{align*}
Because $V \in \tau_Y$ was arbitrary, $f$ is continuous.
[guided]
We now take preimages of the basis decomposition of $V$. The preimage operation commutes with arbitrary unions: for every $x \in X$,
\begin{align*}
x \in f^{-1}\left(\bigcup_{B \in \mathcal{I}_V} B\right)
\iff f(x) \in \bigcup_{B \in \mathcal{I}_V} B
\iff \exists B \in \mathcal{I}_V \text{ such that } f(x) \in B
\iff x \in \bigcup_{B \in \mathcal{I}_V} f^{-1}(B).
\end{align*}
Therefore
\begin{align*}
f^{-1}(V)
&= f^{-1}\left(\bigcup_{B \in \mathcal{I}_V} B\right) \\
&= \bigcup_{B \in \mathcal{I}_V} f^{-1}(B).
\end{align*}
For each $B \in \mathcal{I}_V$, the definition of $\mathcal{I}_V$ gives $B \in \mathcal{B}_Y$. Hence $f^{-1}(B) \in \tau_X$ by the hypothesis of this implication. Since $\tau_X$ is a topology on $X$, it is closed under arbitrary unions, so
\begin{align*}
\bigcup_{B \in \mathcal{I}_V} f^{-1}(B) \in \tau_X.
\end{align*}
Thus $f^{-1}(V) \in \tau_X$. Since $V \in \tau_Y$ was arbitrary, the preimage of every open subset of $Y$ is open in $X$, which is exactly the statement that $f$ is continuous.
[/guided]
[/step]