Metric Space Continuity by Neighborhood Basis

Theorem
Let $M_1 = \left({A_1, d_1}\right)$ and $M_2 = \left({A_2, d_2}\right)$ be metric spaces.

Let $f: A_1 \to A_2$ be a mapping from $A_1$ to $A_2$.

Let $a \in A_1$ be a point in $A_1$.

Let $\mathcal B_{f \left({a}\right)}$ be a basis for the neighborhood system at $f \left({a}\right)$.

$f$ is continuous at $a$ with respect to the metrics $d_1$ and $d_2$ :
 * for each neighborhood $N$ in $\mathcal B_{f \left({a}\right)}$, $f^{-1} \left[{N}\right]$ is a neighborhood of $a$.

Proof
By definition, $\mathcal B_{f \left({a}\right)}$ be a basis for the neighborhood system at $f \left({a}\right)$ :
 * $\forall N_a \subseteq M_2: \exists N \in \mathcal B_{f \left({a}\right)}: N \subseteq N_a$

where $N_a$ denotes a neighborhood of $f \left({a}\right)$ in $M_2$.

Necessary Condition
Let $f$ be continuous at $a$ with respect to the metrics $d_1$ and $d_2$.

Then by Metric Space Continuity by Inverse of Mapping between Neighborhoods:
 * for each neighborhood $N$ of $f \left({a}\right)$ in $M_2$, $f^{-1} \left[{N}\right]$ is a neighborhood of $a$.

In particular, let $N \in \mathcal B_{f \left({a}\right)}$.

Then $f^{-1} \left[{N}\right]$ is a neighborhood of $a$.

Sufficient Condition
Let $f$ be such that:
 * for each neighborhood $N$ in $\mathcal B_{f \left({a}\right)}$, $f^{-1} \left[{N}\right]$ is a neighborhood of $a$.

Let $N'$ be any neighborhood of $f \left({a}\right)$.

Then by definition:
 * $\exists B \in \mathcal B_{f \left({a}\right)}: B \subseteq N'$

From :
 * $f^{-1} \left[{B}\right] \subseteq f^{-1} \left[{N'}\right]$

By hypothesis $f^{-1} \left[{B}\right]$ is a neighborhood of $a$.

From Superset of Neighborhood in Metric Space is Neighborhood it follows that $f^{-1} \left[{N'}\right]$ is a neighborhood of $a$.

As $N'$ is arbitrary, the result follows.