I've being struggling with the following problema in Lee's book on topological manifolds.
Let $X$ and $Y$ be topological spaces. Let $f:X\to Y$ be a map such that $p_n \to p$ (convergent sequence) in $X$ implies $f(p_n) \to f(p)$ in $Y$. If $X$ is first countable, then $f$ is continuous.
I've found the following proof:
By hypotesis, the point $p \in X$ has a countable neighborhood basis $\{U_i\}_{i \in \mathbb{N}}$. Then it admits a nested neighborhood basis, that is, for $n<m$, $U_n \subseteq U_m $. Let $V \subseteq Y$ be a neighborhood of $f(p)$ and suppose that $\forall n \in \mathbb{N}$, $f(U_n) \nsubseteq V$. For each $n \in \mathbb{N}$, take $p_n \in U_n$ such that $f(p_n) \in V$. However, $f(p_n) \to f(p)$ and $f(p_n) \notin V$, which is a contradiction. Therefore, there is some $n \in \mathbb{N}$ for which $f(U_n) \subseteq V$, thus $f$ is continuous at $p$.
How does this imply the continuity of $f$?
The characterization of continuity the proof is using is the following:
I'll re-state the proof on a more clear way:
WLOG, we'll assume all nbs are open (if not, just take any open set contained in it that contains the point).
Let $V(f(p))$ be any nbd of $f(p)$.
Contradicting assumption: $\forall n\in\mathbb{N},\;f(U_n) \nsubseteq V$.
We define a sequence $p_n\in U_n$ such that $f(p_n)\notin V$ (only possible due to the contradicting assumption), that is $f(p_n)\in\mathscr{C}V$ (which is closed). It is clear that $p_n\to p$ and thus by hypothesis, $f(p_n)\to f(p)$. Note that $(f(p_n))_{n\in\mathbb{N}}$ is a convergent sequence in $\mathscr{C}V$ and thus $f(p)\in \mathscr{C}V$ (since $\mathscr{C}V$ is closed), that is $f(p)$ is not in its nbd, a contradiction.
We conclude that there is a nbd of $p$; $U(p):=U_{n_0}$ such that $f(U(p))\subseteq V(f(p))$. By the characterization quoted in the beginning, we are done.
EDIT: Btw, in what was just written, I assumed $n\leq m\implies U_m\subseteq U_{n}$. As I write this, I have spotted a mistake in the original proof (in your question): the proof in your question assumes $n\leq m\implies U_n\subseteq U_m$; this doesn't allow you to conclude $p_n\to p$.
Conclusion: The proof works just fine given that you fix the typo I mentioned in the comments. [NOTE: read the edit].