TITLE: Proof verification: if $\int_a^b \sqrt{f(x)+g(x)}\,dx=0$, $f$ and $g$ are both non-negative, and $f$ is continuous, then $f\equiv 0$.
QUESTION [6 upvotes]: As a math-for-fun exercise, and also to supply my problem-solving toolbox with new inequalities, I challenged myself to attack this problem:

If $\int_a^b \sqrt{f(x)+g(x)}\,dx=0$, $f$ and $g$ are both non-negative on $[a,b]$, and $f$ is continuous on $[a,b]$, is $f$ identically $0$ on $[a,b]$?

I think I've produced an argument that proves the answer is yes. Here it is:
Suppose, for the sake of finding a contradiction, that $\int_a^b \sqrt{f(x)+g(x)}\,dx=0$, $f$ and $g$ are both non-negative on $[a,b]$, and $f$ is continuous on $[a,b]$, but $f$ is not identically $0$. Then for some $x_0\in[a,b]$, we have $f(x_0)\neq 0$. Since $f$ is non-negative, this reduces to $f(x_0)>0$.
Clearly either $x_0\in(a,b)$, $x_0=a$, or $x_0=b$. If $x_0\in(a,b)$, then the continuity of $f$ implies that for every $\varepsilon >0$, there is a $\delta>0$ such that for every $x\in[a,b]$, $x\in[x_0-\delta,x_0+\delta]$ implies $|f(x)-f(x_0)|<\varepsilon$. In particular, this is true for $f(x_0)$, since $f(x_0)>0$. Thus, for some $\delta>0$,
$$|f(x)-f(x_0)|<f(x_0)\text{ for every }x\in[x_0-\delta,x_0+\delta]$$
$$\iff 0<f(x)<2f(x_0)\text{ for every }x\in[x_0-\delta,x_0+\delta]$$
This shows that $f$ is strictly positive on $[x_0-\delta,x_0+\delta]$. Since $g$ is non-negative, we have that $g(x)\geq 0$ on $[a,b]$, so
$$f(x)+g(x)\geq f(x)>0\text{ for every }x\in[x_0-\delta,x_0+\delta]$$
$$\implies\sqrt{f(x)+g(x)}\geq\sqrt{f(x)}>0\text{ for every }x\in[x_0-\delta,x_0+\delta]$$
$$\implies\int_{x_0-\delta}^{x_0+\delta}\sqrt{f(x)+g(x)}\text{ }dx>0$$
Noting that $\int_{a}^{x_0-\delta}\sqrt{f(x)+g(x)}\text{ }dx\geq 0$ and $\int_{x_0+\delta}^{b}\sqrt{f(x)+g(x)}\text{ }dx\geq 0$, we deduce that their sum is at least zero. This gives the contradiction
\begin{align*}
\color{blue}{0} &= \int_{a}^{b}\sqrt{f(x)+g(x)}\text{ }dx\\
&= \int_{a}^{x_0-\delta}\sqrt{f(x)+g(x)}\text{ }dx+\int_{x_0-\delta}^{x_0+\delta}\sqrt{f(x)+g(x)}\text{ }dx+\int_{x_0+\delta}^{b}\sqrt{f(x)+g(x)}\text{ }dx\\
&\color{red}{>} \int_{a}^{x_0-\delta}\sqrt{f(x)+g(x)}\text{ }dx+\int_{x_0+\delta}^{b}\sqrt{f(x)+g(x)}\text{ }dx\\
&\geq \color{green}{0}
\end{align*}
If $x_0=a$ or $x_0=b$, a similar argument applies, the only difference being that we use $[x_0,x_0+\delta]$ and $[x_0-\delta,x_0]$ for $x_0=a$ and $x_0=b$, respectively. We conclude that the stated assumptions necessitate $f$ being identically $0$ on $[a,b]$. $\blacksquare$
I greatly appreciate any and all feedback.

REPLY [5 votes]: I'd use $\varepsilon=f(x_0)/2$ rather than $\varepsilon= f(x_0).$
Then you can say that for $x\in\text{domain}\cap(x_0-\delta,x_0+\delta),$ you have $f(x)> f(x_0)/2,$ so $\sqrt{f(x)+g(x)} > \sqrt{f(x_0)/2\,}>0.$ And then you can say the integral is at least $\sqrt{f(x_0)/2\,}\cdot 2\delta>0.$