TITLE: Fundamental lemma of calculus of variations with second derivative
QUESTION [9 upvotes]: Intense debate at work place around the solution for this:
Let $M \in C[a,b]$ be a continuous function on the closed interval $[a,b]$ that satisfies $$\int_{a}^{b}M(x)\eta^{\prime\prime}dx = 0,$$  for all $\eta \in C^{2}\left[a,b\right]$ satisfying 
$\eta(a) = \eta(b) = \eta^{\prime}(a) = \eta^{\prime}(b) = 0$.
Prove that $M(x) = c_{0}+c_{1}x$ for suitable $c_{0}$ $c_{1}$.  What can you say about $c_{0}$, $c_{1}$?
I tried to use integration by parts, and use the fundamental lemma of the calculus of variations, and the lemma of Du Bois and Reynolds to prove it, but that requires $M$ to be $C^1([a, b])$.

REPLY [6 votes]: This solution is more elementary than the one of Brian Moehring because it does not use mollificators. It also has the advantage of explicitly giving $c_0$ and $c_1$, as requested in the question.
Let me make a minor notation change and assume that $m\in C([0, 1])$ is the function with the property that 
$$
\int_0^1 m(t)\eta''(t)\, dt = 0, \qquad \forall \eta\in C^2, $$
where 
$$
\tag{*}\eta(0)=\eta(1)=\eta'(0)=\eta'(1)=0.$$ 
Define 
$$\tag{1}
M(x):=\int_0^x (m(t)-c_0-c_1t)(x-t)\, dt, $$ 
where $c_0, c_1$ are chosen in such a way that $M$ satisfies the boundary conditions (*). (See Remark, below, for more information on (1)). This amounts to solving a system of 2 linear equations in 2 unknowns, which is not singular, and thus admits one and only one such solution regardless of $m$. (The solution is given in the Appendix, below). 
Now notice that the assumption on $m$ implies that, for every polynomial $P$ of degree 1, and for every smooth $\eta$ satisfying (*), we have that 
$$\tag{2} 0=\int_0^1(m(t)-P(t))\eta''(t)\, dt.$$ Indeed, integration by parts shows that $\int_0^1 P(t)\eta''(t)\, dt=0$. Using (2), we compute 
$$
0=\int_0^1 (m(t)-c_0-c_1 t)M''(t)\, dt = \int_0^1 (m(t)-c_0-c_1t)^2\, dt, $$ 
which finally implies 
$$
m(t)=c_0+c_1 t.$$
Remark. How did I come up with the formula for $M$? That is actually a special case of a general formula; the function 
$$
M(x)=\int_0^x \frac{(x-t)^{n-1}}{(n-1)!} m(t)\, dt $$ 
satisfies $M(0)=M'(0)=\ldots=M^{(n-1)}(0)=0$ and 
$$
M^{(n)}(x)=m(x), $$ 
and is therefore known as "a $n$-th antiderivative of $m$".
Appendix. The values of $c_0, c_1$ are: 
$$
c_0=2\int_0^1 m(t)\, dt -\frac12\left( m(1)-m(0)\right), \quad c_1=m(1)-m(0).$$