Lemma (continuous iff preimage of base elements is open)

Let $(X,\tau)$ and $(Y,\rho)$ be topological spaces, and $\mathcal{B}$ be a base for $\rho$.

A function $f:X\to Y$ is continuous iff $f\inv(B)$ is open for all $B\in \mathcal{B}$.

Proof