Proving that a function is continuous. Let $(X, \tau_X)$ a Hausdorff space and first countable. If for all compact set $K$ in $X$ the restriction $f|_K$ is continuous then $f:(X, \tau_X) \to (Y, \tau_Y)$ is continuous.
I thought to prove that $X$ is compact and then take $K = X$, but I think there is no guarantee that $X$ is compact.
 A: Fact 1: $f$ is continuous at $a \in X$ if and only if for every sequence $(x_n) \subseteq X$ with $x_n \to a$ it holds $f(x_n) \to f(a)$.
Proof outline: The if direction is easy. For every neighborhood $U$ of $f(a)$ there exists a neighborhood $W$ of $a$ such that $f(W) \subseteq U$. Now since $x_n \to x$ there exists some $N \in \mathbb{N}$ such that $x_n \in W$ for all $n \geq N$. This implies that $f(x_n) \in U$ for all $n \geq N$ so $f(x_n) \to f(a)$
For the only if direction assume that $f$ is not continuous at $a$. Then we can find a neighborhood $U$ of $f(a)$ such that for every neighborhood $W$ of $a$, $f(W) \not\subseteq U$. Now consider a countable neighborhood $\{B_n: n \in \mathbb{N}\}$ of $a$ ordered by "$\supseteq$" and select for each $n\in \mathbb{N}$ a $x_n \in B_n$ such that $f(x_n) \notin U$. In that way we constructed a sequence $x_n \to a$ with $f(x_n) \not\to f(a)$, a contradiction.
Fact 2: If $x_n \to a$ then the set $K = \{x_n:n\in \mathbb{N}\} \cup \{a\}$ is compact.
Proof outline: Consider an open cover $\{U_i: i \in I\}$ of $K$. Then for some $i_0$ it must be the case that $a \in U_{i_0}$. But since $x_n \to a$, $U_{i_0}$ must contain all but finitely many of the $x_n$'s.
Now that we have proven those facts we can put a solution together. Let $a \in X$ and $x_n \to a$ be a convergent sequence in $X$. Let $K = \{x_n:n\in \mathbb{N}\} \cup \{a\}$. Since $K$ is compact and $f|_K$ is continuous $f(x_n) \to f(a)$ and since $(x_n)$ is arbitrary $f$. is continuous at $a$. Since $a$ was also arbitrary $f$ is continuous.
Notice that the Hausdorff condition is not needed!
A: Following the hints of @TheoBendit. We have to use the following

Theorem: Let $(X, \mathcal{T}_X),(Y,\mathcal{T}_Y)$ be topological spaces. Then, if $X$ is first countable and for every sequence $\{x_n\}_{n \in \mathbb{N}}$ in $X$ we have $x_n \to x \implies f(x_n) \to f(x)$, we conclude that f is continuous.

Proof: Let $U \subset Y$ be a closed set. Then consider $\{ x_n \}_{n \in \mathbb{N}} \subset f^{-1}(U)$ a convergent sequence such that $x_n \to x$. Now notice that because ${f(x_n)} \to f(x)$ and $U \subset Y$ is closed we conclude that $f(x) \in U$, so that $x \in f^{-1}(U)$ and hence $f^{-1}(U)$ is closed (because if $X$ is a first-countable space then $U \subset X$ is closed iff for every $\{ x_n \}_{n \in \mathbb{N}} \subset U$ we have $x_n \to x \implies x \in U$). $\blacksquare$
So now, let's prove the hypothesis for this theorem. Let $\{x_n\}_{n \in \mathbb{N}}$ be such that $x_n \to x$. Then $K = \{x_n \} \cup \{x\}$ is a compact set, and because $f$ is continuous on $K$, we conclude that $f(x_n) \to f(x)$.
$K = \{x_n \} \cup \{x\}$ is a compact set because if $\mathcal{U}$ is an open cover of K, then there is $U \in \mathcal{U}$ such that $x \in U$ and $i \geq N \implies x_i \in U$ for some $N \in \mathbb{N}$, which implies that only a finite number of elements of the sequence are not covered by $U$
