$(X,d)$ is a metric space, prove $C(X)$ is a finite-dimensional vector space $\Leftrightarrow$ $X$ is a finite set Let be $(X,d)$ a metric space. I know the set $C(X)$ of all continuous real-valued functions is a real vector space. I want to show that $C(X)$ is a finite-dimensional vector space if and only if $X$ is a finite set.
For $X$ being a finite set, one idea (not sure if it's even useful) is to separate $X$ into two finite sets which are two closed sets, from there use Urysohn’s Lemma to give a continuous function that's $0$ on one set and $1$ on the other set, but I'm not sure how or if it even does give me a way to show that $C(X)$ has a finite basis.
Any help is appreciated, cheers. 
 A: If $X$ is finite, and metrisable, it's a discrete space, and all functions on $X=\{x_1,\ldots ,x_n\}$ are continuous and so $C(X)$ is just homeomorphic to $\Bbb R^n$ in the supremum norm $\|\cdot\|_\infty$, which is just $\Bbb R^n$ in the product or Euclidean topology, and so $C(X)$ is finite-dimensional, $\dim C(X)=|X|$.
Suppose that $\dim(C(X))=m < \infty$. Suppose that $X$ were infinite then let $D_m \subseteq X$ be a set of $m+1$ distinct points in $X$. As a subspace this is closed and discrete (this would already hold in a $T_1$ space) and the function $F: C(X) \to C(D_m)$ defined by $F(f)=f\restriction_{D_m}$ is linear, continuous and onto (by Tietze), and as $\dim(C(D_m))= \dim \Bbb R^{m+1} = m+1$ (as above), it follows that $\dim(C(X)) \ge m+1$ by standard linear algebra too, contradiction. So $X$ is finite and this proves the reverse implication. 
A: If possible let there be  a sequence $x_1,x_2,...$ of distinct points in $X$. There exists  continuous function $f_n: X \to [0,1]$ such that $f_n(x)=1$ if $x \in \{x_1,x_2,...,x_n\}$ and $f_n(x_{n+1})=0$. This sequence is in the closed unit ball Of $C(X)$ which is finite dimensional. Hence there is  a subsequence which converges uniformly. Clearly the limit function has the property that $f(x_i)=1$ for all $i$. Now get a contradiction by observing that $\sup_i |f_n(x_i)-1| \geq 1$ for all $n$. 
