# Compact, not local uniform convergence of sequences of functions on the rationals

I stumbled upon the following elementary problem while trying to come up with a certain counterexample in category theory. (Basically, I am interested in the constant sheaf of $\mathbb F_2$-vector spaces on the topological space $\mathbb Q$ of rational numbers; but understanding this motivation in not at all necessary in order to understand the question.)

Let $\mathbb Q$ be the set of all rational numbers, embedded as a subset into the set of all real numbers $\mathbb R$ and endowed with the induced real topology. Can one produce a sequence of locally constant $0$-$1$ valued functions $f_n$, $\,n=1$, $2$, $\dots$ on $\mathbb Q$ with the following properties?

On the one hand, for any compact subset $K$ in $\mathbb Q$ there should exist $N\in\mathbb N$ such that for all $n>N$ the restriction of $f_n$ to $K$ is identically zero. On the other hand, there should be a point $q\in\mathbb Q$ such that for any neighborhood $U$ of $q$ in $\mathbb Q$ and any $N\in\mathbb N$ there exists $n>N$ such that $f_n$ is not identically zero on $U$.

Can one construct such a sequence of functions on $\mathbb Q$ ?

Let me mention that infinite compact subsets $K$ certainly exist in $\mathbb Q$; e.g., $\{1,1/2,1/4,\dots,0\}$ is such a subset. On the other hand, there is a feeling that compact subsets in $\mathbb Q$ are "small" as compared to nonempty open subsets. Hence the question.

For every $k$, choose some $n>k$ and $q_k\in U_{1/k}(q)$ such that $f_n(q_k)=1$. Then the set $K=\{q_k\colon k\in\mathbb N\}\cup\{q\}$ is compact (since $q_k\to q$), but $(f_n)$ is not eventually vanishing on $K$.