I am doing some reading on the calculus of variations and one of the first examples uses the following theorem:
Let $f\in C[a,b]$. If $\int_a^b f(x)\varphi(x)dx=0$ for all $\varphi\in C[a,b]$, then $f\equiv 0$.
Intuitively this is clear. But I am not sure how to prove this. I was thinking of using the mean value theorem for integrals. Since $f,\varphi$ are continouus they are integrable and hence there exists $\xi\in [a,b]$ such that
$$0=\int_a^b f(x)\varphi(x)dx=f(\xi)\int_a^b\varphi(x)dx$$
Assuming $f\equiv\hspace{-1.5ex}|\hspace{1ex} 0$, we can assume $f(\xi)\neq 0$ and hence get $\int_a^b\varphi(x)dx$, but this definitely does not hold for all contiouus functions on $[a,b]$.
Thus $f\equiv 0$ on $[a,b]$.
Is this a way to argue? Or how can I prove this differently? Thanks!