Existence of non-locally constant functions Given a nondiscrete compact Hausdorff space $K$, does there always exist a real-valued function $f$ on $K$ that is not locally constant? Why/why not?
In http://arxiv.org/abs/math/9505204 the authors show that there are compact Hausdorff spaces $K$ such that all $f \in C(K)$ are locally constant on a dense subset (example: $\beta \mathbb{N} \setminus \mathbb{N}$). However, they do not mention anything about functions that are locally constant everywhere.
 A: A $P$-space is a completely regular space where the countable intersection of open sets is open. It is well known and easy to prove that that a completely regular space is a $P$-space if and only if every continuous function is locally constant.
In fact, there are several other necessary and sufficient conditions for whether a space is a $P$-space and these conditions can be found in the book Rings of Continuous Functions by Gillman and Jerison. The only compact $P$-spaces are the finite spaces:  First take note that every $P$-space is zero-dimensional(i.e. it has a basis of clopen sets). If $X$ is an infinite $P$-space, and $A\subseteq X$ is a countable subset, then for each $a,b\in A$ with $a\neq b$, let $\{C_{a,b,1},C_{a,b,2}\}$ be a partition of $X$ into two clopen sets such that $a\in C_{a,b,1},b\in C_{a,b,2}$. Let $P=\bigcap_{a,b\in P}\{C_{a,b,f(a,b)}|f:A^{2}\setminus 1_{A}\rightarrow\{1,2\}\}.$ Then $P$ is a partition of $X$ into infinitely many clopen sets. Therefore $X$ cannot be compact.
A: Since $K$ is infinite, you can find a sequence $(x_n)$ in $K$ converging to a point $x$. There exists a function $f_n: K\rightarrow [0,1]$ with $f(x)=0$, $f(x_n)\neq 0$ (compactness is not necessary, you just need that functions separate points: uniformizable is enough). Take $f=\sum 2^{-n}f_n$ .
