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.



Compact, not local uniform convergence of sequences of functions on the rationals
No, such sequence of functions does not exist, even without the local constantness hypothesis.


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


