TITLE: Show that the vector space of all continuous real-valued functions is infinite-dimensional
QUESTION [5 upvotes]: Show that the vector space $C(\Bbb R)$ of all continuous functions defined on the real line is infinite-dimensional.

I get that if $C(\Bbb R)$ contains an infinite-dimensional subspace, then it is infinite-dimensional, but how do I prove that? Obviously $\Bbb R$ is infinite…

REPLY [2 votes]: (1). Let $(a_n)_{n\in \mathbb N}$ be a strictly increasing real sequence, converging to $A.$ Suppose that for each $n$ there exists continuous $f_n:\mathbb R\to \mathbb R$ such that $(x<A\land f_n(x)=0)\iff x\in \{a_j:j\geq n+1\}.$ Then $S=\{f_n:n\in \mathbb N\}$ is an infinite linearly independent set.
Because if $T$ is a non-empty finite subset of $S,$ let $n_T$ be the largest $n$ such that $f_n\in T.$ So  $f_{n_T}\ne f\in T\implies f(a_{n_T})=0,$  while $f_{n_T}(a_{n_T})\ne 0. $ So if $\{r_f:f\in T\}$ is a set of non-zero numbers we have $$\forall x\;(\sum_{f\in T}r_f f(x)=0)\implies \sum_{f\in T}r_ff(a_{n_T})=0\implies r_{n_T}f_{n_T}(a_{n_T})=0\implies r_{n_T}=0,$$ a contradiction to $r_{n_T}\ne 0.$
(2). To obtain such $S$:  Let $g :[a_2,A)\to \mathbb R$ be continuous such that for $n\in \mathbb N$ we have $  [a_{n+1},a_{n+2}]$ with $g(a_{n+1})=0=g(a_{n+2})$ and $0\ne|g(x)|
\leq 2^{-n}$ for $x\in (a_{n+1},a_{n+2}).$ 
For example let $g(x)=2^{-n}\frac {(x-a_{n+1})(x-a_{n+2})}{(a_{n+2}-a_{n+1})^2}$ for $ x\in [a_{n+1},a_{n+2}].$ 
Now let $f_n(x)=x-x_{n+1}$ for $x<x_{n+1},$ and $f_n(x)=x-A$ for $x\geq A,$ and $f_n(x)=g(x)$ for $x\in [a_{n+1}, A).$ 
(...It is easy to show that each $f_n(x)$ is continuous at $x=A$, using $f_n(A)=0$  and $\sup \{|g(x)|:x\in [a_{j+1},a_{j+2}\}\leq 2^{-j}$ for all $j$.)
This proof also applies to the set of continuous $f:J\to \mathbb R$ for any interval $J\subset  \mathbb R$  of non-zero length, as we may take $\{A\}\cup \{a_n:n\in \mathbb N\}\subset J.$