Linear algebra done right, Exercise 16, section 2.A This question asks to prove that the real vector space of all continuous real-valued functions on the interval $[0,1]$ is infinite-dimensional. In an earlier question it was proved that a vector space $V$ is infinite-dimensional if and only if there exists a sequence of vectors $\{v_j\}$ such that $$v_1, v_2, \ldots, v_m$$ is linearly independent for every positive integer $m$.
I worked with the question and got this proof.
Consider a sequence of such functions $\{f_j\}$ where $f_k(x) = x^k$ for all $k \in \mathbb N$. It's easy to see that $$f_1, f_2, \ldots, f_m$$is linearly independent for all positive integer $m$. Thus this vector space is infinite-dimensional.
However, when I checked the solution on this website, https://linearalgebras.com/2a.html, they constructed the function as $$f_k(x) = \begin{cases}x-\frac 1 k, & x\geq \frac 1 k; \\ 0, & \text{otherwise}. \end{cases}$$
I want to ask if there are any flaws in my proof.
 A: Proving that your sequence has the requested property is actually easy: suppose $a_0f_0+a_1f_1+\dots+a_mf_m=0$ (the constant zero function). I also use $f_0(x)=1$, not to leave poor $0$ alone.
Then, for every $r\in\mathbb{R}$, we have
$$
a_0+a_1r+\dots+a_mr^m=0
$$
and so, if not all the coefficients are zero, the polynomial $a_0+a_1x+\dots+a_mx^m$ has infinitely many roots in the interval $[0,1]$, contradicting the easy to prove theorem that a polynomial has at most as many distinct roots as its degree.
Proof. A nonzero constant polynomial has at most zero roots. Suppose all polynomials of degree $k$ have at most $k$ distinct roots. Let $f(x)$ be a degree $k+1$ polynomial; if it has no roots, we have nothing to prove. Otherwise it has a root $c$ and we can write $f(x)=(x-c)g(x)$, where $g$ has degree $k$, so at most $k$ distinct roots. Thus $f$ has at most $k+1$ distinct roots. QED
Possibly the author deemed easier not to use algebra of polynomials.
A: There are not, but to show $f_0, f_1, \cdots, f_m$ are linearly independent is not totally trivial. (While there is no essential difference, it's better to include the constant function $1$ in the set, instead of only monomials of higher degree.)
To show $f(x):=\sum_{n=0}^m a_n x^n=0, \forall x\in [0, 1]$ implies $a_1=a_2=\cdots=a_m=0$, we may pick $0<x_1<x_2<x_3<\cdots<x_m<1$ in $[0, 1]$ so that $$\begin{pmatrix} 1 & x_1 & x_1^2 & \cdots & x_1^m \\ 1& x_2 & x_2^2 & \cdots & x_2^m \\ \vdots & \vdots & \vdots & \vdots & \vdots \\ 1& x_m & x_m^2 & \cdots & x_m^m\end{pmatrix} \begin{pmatrix} a_0 \\ a_1 \\ a_2 \\ \vdots \\ a_m \end{pmatrix} = O$$
Note that the matrix is the Vandermonde matrix, which is invertible, hence $a_0=\cdots=a_m=0$. (Though I guess this is against the spirit of Linear Algebra Done Right which argues against determinant.)
Another way to do this is to use calculus. If $\sum_{n=0}^m a_nx^n=0$ for all $x\in[0,1]$, then $f(0)=a_0=0$, and $f'(0)=a_1=0$, $f''(0)=2!a_2=0$ and so on.
Now perhaps it's easier to understand the motivation for defining $f_k$. If we can find a family of functions $f_1, f_2, \cdots$ associated with a sequence of points $x_1, x_2, \cdots$ such that $f_i(x_j)=0$ iff $i\not=j$, then it's easier to show $f_i$'s are linearly independent.
Instead of the $f_k$'s cited from the web, we may also use $$f_0=1, f_1=(x-1), f_2=(x-1)(x-1/2) \cdots, f_m=\prod_{n=1}^m(x-1/n)$$ Now if $\sum_{n=0}^m a_nf_n=0$, let $x=1$, we know $a_0=0$, then let $x=1/2$, we get $a_1=0$ and so on.
A: Pick $x_1,\ldots,x_n\in[0,1]; x_i\neq x_j, i\neq j$, and let
$$
p_j(t)=\frac{\prod_{i\neq j}(t - x_i)}{\prod_{i\neq j}(x_j - x_i)}.
$$
Now note that $p_j$ is continuous on $[0,1]$, $p_j(x_j) = 1$ and $p_j(x_i)=0$ if $i \neq j$. Finally observe that $$0=\sum_{i=1}^n a_i p_j(x_i) = a_j$$ for all $j=1,\ldots,n$.
