If $\int_0^1 f(x) g(x)=0$ for all twice differentiable g with g(0)=g(1)=0 , and if f is continuous then show $f\equiv0$

calculusderivativesreal-analysis

Suppose $f :[0,1]\rightarrow\mathbb{R}$ be a continuous function and , $$\int_0^1 f(x) g(x)dx=0$$ for all twice differentiable $g$ with $g(0)=g(1)=0$ ,

I have to show $f\equiv0$.

$\textbf{Try}$ :
I tried to substitute $g$ with some function of $f$. But as it is not guaranteed that $f$ is twice differentiable, I cannot take $g(x)=a(x)f(x)$ for some real function a , since we need g to be twice differentiable on [0,1] . Can you please provide me with some ideas?

Best Answer

Since $f$ is continuous, if $f\ne 0$ there exist $a,b$ with $0\le a<b\le 1$ with $\forall x\in [a,b]\,(f(x)>0)$ or $\forall x\in [a,b]\,(f(x)<0).$ Consider $g(x)=0$ for $x<a$ or $x>b,$ and $g(x)=(x-a)^4(b-x)^4$ for $x\in [a,b].$