# Convergence of a Continuous Function and Compactness of Upper Contour Sets

Suppose that $(X,\tau)$ is a locally compact, but not compact, Hausdorff topological space and $f:X\to\mathbb{C}$ is a continuous function. A sequence $(x_n)_{n\in\mathbb{Z}_+}$ in $X$ is said to have property (P) if, whenever $U\subseteq X$ and there exists some $A\subseteq U$ such that $A^c$ is compact, then there must exist some $N\in\mathbb{Z}_+$ such that for all $n>N$, $x_n\in U$. Intuitively, property (P) requires that the sequence eventually escape from all compact subsets of $X$ (or “diverge to infinity,” if you will).

Suppose that $f$ has the following property: If $(x_n)_{n\in\mathbb{Z}_+}$ is a sequence that has property (P), then for any $\varepsilon>0$ there exists some $N\in\mathbb{Z}_+$ such that for all $n>N$, $|f(x_n)|<\varepsilon$.

$\textbf{Claim:}\quad$ If $f$ has the said property, then the set $$T_{\varepsilon}\equiv\{x\in X:|f(x)|\geq\varepsilon\}$$ must be compact for all $\varepsilon>0$.

I tried many ways to prove this claim, but I am still struggling. I have already proved the converse: if $f$ is continuous and the $T_{\varepsilon}$ are compact, then $(f(x_n))$ converges to $0$ whenever $(x_n)$ has property (P). The other direction has eluded me so far. I wonder if you could give me some hints. Thank you in advance.

$\textbf{Update:}\quad$ I realized that the statement may not be true. I conjecture that if $X$ has a really nasty structure in terms of countability (in particular, if it is not even $\sigma$-compact), then there may exist no sequence with property (P). There may be so many compact subsets of $X$ that no countable sequence can eventually escape from all of them. (But note that this is merely a conjecture.) In this case, any continuous function vacuously has the property in the main claim (because there are no sequences with property (P)), even those for which not all of the $T_{\varepsilon}$ are compact.

In turn, I reformulated the statement in terms of nets, stating that if $f$ is such that for any net $(x_{\alpha})_{\alpha\in A}$ ($A$ is a nonempty directed index set) that eventually escapes from any compact subset of $A$ the associated net $(f(x_{\alpha}))$ in $\mathbb{C}$ tends to $0$, then the $T_{\varepsilon}$ must be all compact. In this case, the proof follows in both directions.

Your conjecture is right, such a nasty space $X$ exists. For instance, let $X$ be $\omega_1$ endowed with the order topology. Then $X$ is a locally compact countably compact non-compact space and each sequence $S$ in $X$ is bounbed by a countable ordinal $\alpha$ and hence $S$ is contained in a compact segment $[0;\alpha]\subset\omega_1$. Then any continuous function vacuously has the property in the main claim (because there are no sequences with property (P)), and for a constant function $f\equiv 1$ the set $T_{\frac 12}=X$ is not compact.
From the other side, maybe we can characterize all locally compact non-compact spaces satisfying the statement. For instance, maybe the statement holds for the space $X$ iff $X$ is $\sigma$-compact (I did not think about it).