Does $\int_{I}f(t)g(t)dt = 0$ for every $g|_{\partial I} = 0$ implies $f\equiv 0$? Let $I=[t_{0},t_{1}]$ be a bounded interval of $\mathbb{R}$ and suppose $f: I \to \mathbb{R}$ is $C^{k}(I)$ for some $k \ge 2$. Suppose that:
$$\int_{t_{0}}^{t_{1}}f(t)g(t) dt = 0$$
for every $C^{k}(I)$ function $g:I\to \mathbb{R}$ such that $g(t_{0})=g(t_{1}) = 0$. Does it follow that $f(t) \equiv 0$?
 A: Suppose $f(t_{0}) > 0$ for some $t_{0} \in I$. Then, once $f$ is continuous, there exists $\delta>0$ such that if $t \in (t_{0}-\delta, t_{0}+\delta)\subset I$, then $f(t) \ge c > 0$. Define:
\begin{eqnarray}
\varphi(t) = \begin{cases}
\displaystyle Ke^{-\frac{1}{\frac{\delta^{2}}{4}-(t-t_{0})^{2}}} \quad \mbox{if $t \in (t_{0}-\frac{\delta}{2},t_{0}+\frac{\delta}{2})$} \\
\displaystyle 0 \quad \mbox{otherwise}
\end{cases}
\end{eqnarray}
so that $\varphi \in C_{c}^{\infty}(I)$, $\varphi \ge 0$ and choose $K$ so that:
$$\int_{t_{0}}^{t_{1}}\varphi(t)dt = \int_{t_{0}-\delta/2}^{t_{0}+\delta/2}\varphi(t)dt = 1 $$
Then:
$$\int_{t_{0}}^{t_{1}}f(t)\varphi(t)dt = \int_{t_{0}-\delta/2}^{t_{0}+\delta/2}f(t)\varphi(t)dt \ge c \int_{t_{0}-\delta/2}^{t_{0}+\delta/2}\varphi(t)dt = c > 0 $$
and this contradicts the hypothesis.
A: Elaborating on leoli1's comment, if your $f$ is such that $f(t) = r > 0$ for some $t\in (t_0, t_1)$ then there exists a open $O\subset (t_0, t_1)$, and a closed set $K\subset O$ such that $f(O) \in (0, \infty)$ and $t$ is an interior point of $K$. From known theory we can construct a smooth function (hence also $C^k$) $\phi: [t_0, t_1]\to [0,1]$ such that  $\phi(K) = 1$ and $\phi$ is zero outside of $O$.
For the record, these kind of "bump" functions can be constructed out of the (smooth) partition of unity subordinate to the cover $$\{O, [t_0, t_1]\backslash K\}$$ of $[t_0, t_1]$, explicitly, just take $\phi$ to be function in the partition of unity subordinate to the open $O$ in the above cover.
Clearly $$\int_{t_0}^{t_1}f(t) \phi(t) > 0$$
so we must have  $f(t) = 0$ for all $t\in (t_0, t_1)$ and by continuity of $f$ also on the boundary points. $t_0$ and $t_1$.
