Let $V$ be the space of infinitely differentiable real-valued functions $[0,1]\to \Bbb R$ supported in $(0,1)$. For some fixed positive integer $n$ and a function $f\in L^1[0,1]$, I am asked to show that if the integral $\int_0^1 fg^{(n)}dx=0$ for all $g\in V$ where $g^{(n)}$ is the $n$-th derivative of $g$, then $f$ must be a polynomial of degree $\leq n-1$.
It seems that it suffices to show that $f^{(n)}=0$, but I can't see how to show that $f$ is differentiable. Can I get a hint for this problem?