First Countable Spaces and Limit Preserving Functions 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$?
 A: We need the additional result:
Let $A \subseteq X$ of a first countable space, $x \in \overline{A}$ $\Longleftrightarrow$ $x$ is the limit of some sequence $x_n \in A$.

Let $B \subseteq Y$ be closed. Suppose that $f^{-1}(B)$ is not closed, then there is some $p \in \overline{f^{-1}(B)} \setminus f^{-1}(B)$ and by first countability there is a sequence $a_n \in f^{-1}(B)$ such that $a_n \to p$. We have that $f(a_n) \to f(p)$. However, $f(a_n)\in B$, since $B$ is closed, $f(p) \in f(B)$. This implies that $p \in f(B)$. Which is a contradiction, so $f^{-1}(B)$ is closed.
Since any $p \in A \subseteq X$ for $A$ closed is the limit of some sequence $(p_n)$ (since $X$ is first countable). It follows that $f^{-1}(A)$ is always closed, thus $f$ is continuous.

This seems more plausible than the one presented in the question. I still would like to know if the first proof is valid and if not, is there any change that would make it valid?
A: The characterization of continuity the proof is using is the following:

Let $f\colon X\to Y$. $f$ is continuous at $p$ if and only if for every nbd $V(f(p))$ of $f(p)$, there exists a nbd $U(p)$ of $p$ such that $f(U(p))\subseteq V(f(p))$.

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].
