I am trying to prove the following statement:

Let $X$ and $Y$ be topological spaces. If $X$ is first countable and $f:X \rightarrow Y$ is a map such that $a\_n \rightarrow a$ in $X$ implies $f(a\_n)\rightarrow f(a)$ in $Y$, then $f$ is continuous.

I am missing something critical, as my proof, which I include below, does not use the fact that $X$ is first countable. What is it that I am missing?

Flawed Proof:

Assume $f$ is such a map. Let $U$ be an open set in $Y$. To prove $f$ is continuous, we must show $f^{-1}(U)$ is an open set in $X$. Let $a\_n$ be a sequence converging to $a \in f^{-1}(U)$. By hypothesis, this implies $f(a\_n)$ converges to $f(a) \in U$. So, there exists some $N \in \mathbb{N}$ such that $f(a\_i) \in U$ for all $i \geq N$. This implies $a\_i \in f^{-1}(U)$ for all $i \geq N$. This implies $f^{-1}(U)$ is open since every sequence converging to a pont in $f^{-1}(U)$ is eventually contained in $f^{-1}(U)$.