A proof problem from a first time real analysis course Given a continuous function $g:[a,b]\to\Bbb R$,
if there exists a number $K>0$ s.t. for all $x\in[a,b]$, $|g(x)| \le K \int_a^x |g|$, prove $g(x)=0$ for all $x\in[a,b]$.
And I tried to derive some contradiction around $\inf g^{-1}(\Bbb R-\{0\})$ assuming $g\ne 0$, under given hypothesis, but I wasn't succesful.
 A: Suppose $\sup_{x\in[a,b]} |g(x)|>0$. Since $[a,b]$ is compact and $|g|$ continuous this function attains its maximum in say $x_{0}$. First observe that $|g(a)|=0$ (Put $x=a$ in your inequality). Dividing your inequality by $|g(x_{0})|>0$ you will see that (using $|g(t)/g(x_{0})|\leq 1$ in the integral):
$|g|(x)\leq|g(x_{0})|\cdot K\cdot(x-a)$.
Now you have a majoration for $|g|$, which you should put in your inequality. Do this and you will find that:
$|g|(x)\leq\frac{1}{2}|g(x_{0})|\cdot K^2\cdot(x-a)^2$.
Now repeat this. By induction (for all $n\geq1$):
$|g|(x)\leq\frac{1}{n!}|g(x_{0})|\cdot K^n\cdot(x-a)^n$.
Take $n\to +\infty$ and conclude.
A: If you have already seen some basic differential equations you can use the following technique. Let $u(x)=\lvert g(x)\rvert,\ U(x)=\int_a^x\, u(y)\, dy$. The given inequality can be rewritten as 
$$ \tag{1} U'(x) \le K U(x).$$
We claim that (1) implies that $U \le 0$ on $[a, b]$. Indeed, multiplying both sides of (1) by $\exp(-KU(x))$ we get 
$$e^{-KU(x)}U'(x)- Ke^{-KU(x)}U(x)\le 0 ,$$
so
$$\frac{d}{dx}\left( e^{-KU(x)}U(x)\right)=e^{-KU(x)}U'(x)-e^{-KU(x)}KU(x)\le 0.$$
This means that $\exp({-KU(x)})U(x)$ is nonincreasing on $[a, b]$. Since $\exp({-KU(a)})U(a)=0$, we have $\exp({-KU(x)})U(x)\le 0$  and so $U(x)\le 0$ on $[a,b]$, because exponential is non negative. This proves the claim.
But now we recall that $U(x)$, being the integral of a nonnegative function, is itself nonnegative. The only possibility is that $U\equiv 0$. The only continuous and nonnegative function with a vanishing integral is the null function, so $u\equiv 0$ which means $g\equiv 0$.
This is exactly the technique one uses to prove Gronwall's inequality, which is a useful tool in differential equations.
A: This is essentially equivalent to an exercise in Rudin's Principles of mathematical analysis (Ex. 26, Chaprter 5).
Exercise
Suppose that $f$ is differentiable in $[a,b]$ and that $f(a)=0$. Assume also that a constant $A\in \mathbb{R}$ exists such that $|f'(x)| \leq A |f(x)|$ for every $x \in [a,b]$. Prove that $f(x)=0$ for every $x \in [a,b]$.
The solution follows easily from the hint. Fix $x_0 \in [a,b]$ and let
$$
M_0 = \sup_{a \leq x \leq x_0} |f(x)|, \qquad M_1 = \sup_{a \leq x \leq x_0} |f'(x)|.
$$
Then
$$
|f(x)| \leq M_1 (x_0-a) \leq A(x_0-a)M_0 \quad \text{for $a \leq x \leq x_0$}.
$$
Hence $M_0=0$ is $A(x_0-a)<1$. This means that $f=0$ on $[a,x_0]$. In finitely many steps, we conclude that $f=0$ on $[a,b]$.
Your question is somehow dual to this exercise, and can be solved in a similar manner.
