Skip to main content
1 of 4
Alexandre Eremenko
  • 91.8k
  • 9
  • 259
  • 429

Let $g_0^\prime(x)=|x-1/2|,\; g_0(x)=\int_0^xg_1(t)dt,\; 0\leq x\leq1$. Then $g_0$ has continuus derivative, namely $g_0^\prime$, which is Lipschitz, but the second derivative is discontinuous.

Now define $f(x,y)=0$ when $0\leq x\leq 1, y=g_0(x)$ and $f(x,y)=0$ otherwise. Evidently $f$ is measurable, and $\int_0^1 f(x,g_0(x))dx=0$, while $\int_0^1f(x,g(x))dx>0$ for every $C^2$ function $g$.

Remark. You can make $f$ continuous and even smooth by taking a non-negative smooth function with the same zero set as I described.

Alexandre Eremenko
  • 91.8k
  • 9
  • 259
  • 429