(Thanks for this question, and to Brian M. Scott for his answer. These resulted in an delightful couple of hours of digging back into old topology notes from my university days.)
I'm posting this additional answer, with essentially Mr Scott's proof, to highlight two related reasoning principles that are useful in topological proofs.
First some notation which I invented myself, and which I find useful when working with bases and subbases: we denote the closure of any set $D$ under arbitrary unions and finite intersections as $D^\cup$ and $D^\cap$, respectively:
$$
\begin{align}
& D^\cup = \left\{ \bigcup \mathscr{F} \:|\: \mathscr{F} \subseteq D \right\} \\
& D^\cap = \left\{ F \cap G \:|\: F,G \in D \right\} \\
\end{align}
$$
The first principle, which Mr Scott invokes when he says "it suffices to show" but without proving (2) below, is that for any predicate $\phi(V)$ about a set $V$, we have$$
\langle \forall V \in D^\cup :: \phi(V) \rangle \;\equiv\; \langle \forall V \in D :: \phi(V) \rangle
$$ if we can show that $\langle \forall V \in \mathscr{F} :: \phi(V) \rangle \;\Rightarrow\; \phi(\bigcup \mathscr{F}) \rangle$ for all $\mathscr{F} \subseteq D$.
Similarly the second principle says that $$
\langle \forall V \in D^\cap:: \phi(V) \rangle \;\equiv\; \langle \forall V \in D :: \phi(V) \rangle
$$ follows from $\phi(F) \land \phi(G) \;\Rightarrow\; \phi(F \cap G)$ for all $F,G \in D$. As we will see, these principles can reduce a proof for a topology to a proof for a base, and one for a base to one for a subbase.
Now for the proof itself. We like to know whether $f$ is continuous, or (by definition) whether $$
(0) \;\;\; \langle \forall V \in \tau_Y :: f^{-1}[V] \in \tau_X \rangle
$$ and we are given that $$
(1) \;\;\; \langle \forall V \in B :: f^{-1}[V] \in A \rangle
$$ Since these have a similar structure, and since we are also given that
$$
\begin{align}
& \tau_Y \text{ is the smallest topology on } Y \text{ containing } B \\
\equiv & \;\;\;\;\;\text{"definition of subbase"} \\
& B \text{ is a subbase for } \tau_Y \\
\equiv & \;\;\;\;\;\text{"property of subbase"} \\
& B^\cap \text{ is a base for } \tau_Y \\
\equiv & \;\;\;\;\;\text{"definition of base"} \\
& B^{\cap\cup} = \tau_Y \\
\end{align}
$$
it seems worthwhile to try and reduce $(0)$ to $(1)$ using the above principles. That works out nicely:
$$
\begin{align}
& \langle \forall V \in \tau_Y :: f^{-1}[V] \in \tau_X \rangle \\
\equiv & \;\;\;\;\;\text{"by the above calculation"} \\
& \langle \forall V \in B^{\cap\cup} :: f^{-1}[V] \in \tau_X \rangle \\
\equiv & \;\;\;\;\;\text{"using the first principle and (2) below"} \\
& \langle \forall V \in B^\cap :: f^{-1}[V] \in \tau_X \rangle \\
\equiv & \;\;\;\;\;\text{"using the second principle and (3) below"} \\
& \langle \forall V \in B :: f^{-1}[V] \in \tau_X \rangle \\
\Leftarrow & \;\;\;\;\;\text{"using $A \subseteq \tau_X$"} \\
& \langle \forall V \in B :: f^{-1}[V] \in A \rangle \\
\end{align}
$$
To prove $$
(2) \;\;\; \langle \forall V \in \mathscr{F} :: f^{-1}[V] \in \tau_X \rangle \;\Rightarrow\; f^{-1}\left[\bigcup\mathscr{F}\right] \in \tau_X \; \text{ for all } \mathscr{F} \subseteq B^\cap
$$ we observe that $B^\cap \subseteq {\tau_Y}^\cap = \tau_Y$ (since $B \subseteq \tau_Y$ and $\tau_Y$ is a topology), and for any $\mathscr{F} \subseteq \tau_Y$
$$
\begin{align}
& f^{-1}\left[\bigcup\mathscr{F}\right] \in \tau_X \\
\equiv & \;\;\;\;\;\text{"distribution property of $^{-1}$"} \\
& \bigcup\left\{ f^{-1}[V] \:|\: V \in \mathscr{F} \right\} \in \tau_X \\
\Leftarrow & \;\;\;\;\;\text{"$\tau_X$ is a topology, so closed under arbitrary union"} \\
& \langle \forall V \in \mathscr{F} :: f^{-1}[V] \in \tau_X \rangle \\
\end{align}
$$
Similarly, we prove $$
(3) \;\;\; f^{-1}[F] \in \tau_X \land f^{-1}[G] \in \tau_X \;\Rightarrow\; f^{-1}[F \cap G] \in \tau_X \; \text{ for all } F,G \in B
$$ by using $B \subseteq \tau_Y$, and for any $F,G \in \tau_Y$:
$$
\begin{align}
& f^{-1}[F \cap G] \in \tau_X \\
\equiv & \;\;\;\;\;\text{"distribution property of $^{-1}$"} \\
& f^{-1}[F] \cap f^{-1}[G] \in \tau_X \\
\Leftarrow & \;\;\;\;\;\text{"$\tau_X$ is a topology, so closed under finite intersection"} \\
& f^{-1}[F] \in \tau_X \land f^{-1}[G] \in \tau_X \\
\end{align}
$$
This completes the proof of $(0)$: $f$ is continuous.
Finally, note that we did not need the fact that $\tau_X$ is the smallest topology on $X$ containing $A$.