TITLE: When is the vector space of continuous functions on a compact Hausdorff space finite dimensional?
QUESTION [11 upvotes]: I know that the vector space of all real valued continuous functions on a compact Hausdorff space can be infinite dimensional.  When will it be finite dimensional?  And how will I identify that vector space with $\mathbb{R}^n$ for some $n$?

REPLY [18 votes]: For a topological space $X$, let me write $C(X,\mathbb{R})$ for the set of continuous functions $f: X \rightarrow \mathbb{R}$.  Note that $C(X,\mathbb{R})$ forms a ring under pointwise addition and multiplication which contains $\mathbb{R}$ as the subring of constant functions.
Suppose $X$ is compact Hausdorff.
1) If $X = \{x_1,\ldots,x_n\}$ is finite, then since it is Hausdorff it has the discrete topology so $C(X,\mathbb{R})$ is the set of all functions from $\{x_1,\ldots,x_n\}$ to $\mathbb{R}$.  In this case a natural basis is given by "$\delta$ functions'': i.e., for $1 \leq i \leq n$, let $e_i: X \rightarrow \mathbb{R}$ be such that $e_i(x_j) = \delta_{i,j}$ (i.e., $1$ if $i = j$, $0$ otherwise).  Note that in this case $e_1,\ldots,e_n$ is also a family of idempotent elements giving rise to a direct product decomposition of rings $C(X,\mathbb{R}) \cong \mathbb{R}^n$.  
2) If $X$ is infinite, then for every positive integer $n$ there is a subspace 
$X_n$ consisting of exactly $n$ points.  By Step 1, the dimension of the space 
$C(X_n,\mathbb{R})$ is $n$.  Moreover, since $X$ is Hausdorff, $X_n$ is closed in $X$, 
and, since $X$ is compact Hausdorff, the Tietze Extension Theorem applies to show that every continuous function on $X_n$ extends to a continuous function on $X$.  In other words, the natural restriction map $r_n: C(X,\mathbb{R}) \rightarrow C(X_n,\mathbb{R})$ is surjective.  Since $r_n$ is an $\mathbb{R}$-linear map (indeed a homomorphism of $\mathbb{R}$-algebras), it follows that 
$\operatorname{dim} C(X,\mathbb{R}) \geq \operatorname{dim} C(X_n,\mathbb{R}) = n.$
Since $n$ was arbitrary, we conclude that $\operatorname{dim} C(X,\mathbb{R})$ is infinite.
Added: As Qiaochu points out, it is enough to require that $X$ be what I call "C-separated": i.e., for the continuous $\mathbb{R}$-valued functions to separate points of $X$.  And for this it is enough that $X$ be Tychonoff.  (Recall compact Hausdorff $\implies$ normal $\implies$ Tychonoff.)  In fact these considerations come up in $\S 5.2$ of my commutative algebra notes.  See especially the second exercise in that section, which asks for a justification of the claim I made in the first sentence of this paragraph.
Indeed, since "C-separated" implies Hausdorff, looking back at my answer it shows that one can replace "compact Hausdorff" with "C-separated" and the result still holds.  However, one cannot replace "C-separated" with "regular".  As I have mentioned elsewhere, there are infinite regular spaces $X$ in which the only continuous functions are the constant functions, so $C(X,\mathbb{R}) = \mathbb{R}$ is a one-dimensional space.