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