I am looking for a proof of the following statement which is known to be true as far as I heard. 

Let $g\colon [a,b]\to \mathbb{R}$ be a smooth function. Assume that 
$$b-a\leq \pi.$$
Assume also $$g(a)\geq 0,g(b)\geq 0,$$
$$g''+g\leq 0 \mbox{ on } [a,b].$$
Then $g\geq 0$ on $[a,b]$.