Indefinite Integral and the function Let $f$ be a continuous function on $[a, b]$. Suppose that there exists a positive constant $K$ such that
$$
|f(x)| \leq K \int_{a}^{x}|f(t)| d t
$$
all $x$ in $[a, b]$. Prove that $f(x)=0$ for all $x$ in $[a, b]$.
It would be convenient if we replace the function $f$ with $g(x) = |f(x)|$, where $g$ is continuous and Riemann integrable on given domain.  $$ g(x) \leq K \int_{a}^{x}g(t) dt$$ is satisfied, and we assume there exists a point $x_{0}$ such that $g(x_0) > 0$. What could be the major strategies and original intuition behind finding a contradiction from here if one has only the continuity of $g$ and indefinite integral of $g$.
 A: By continuity of $f$, it is clear that the problem arises for $x$ close to $a$. First of all, we have
$$|f(a)|=\lim_{x\to a} |f(x)| \le \limsup_{x\to a} K \int_a^x |f(t)| dt = 0$$
by continuity of $f$, thus $f(a)=0$. Then define $x_\varepsilon:=\inf\{x>a:|f(x)|\ge \varepsilon\}$. We assume $f\neq 0$, thus for $\varepsilon$ small enough $x_\varepsilon$ is well-defined. There holds
$$\varepsilon \le |f(x_\varepsilon)| \le K\int_{a}^{x_\varepsilon}|f(t)|dt \le K(x_\varepsilon-a)\varepsilon\Rightarrow x_\varepsilon \ge \frac{1}{K}+a,$$
Clearly, $(x_\varepsilon)_{\varepsilon>0}$ is monotone decreasing for $\varepsilon>0$ and thus convergent, we denote the limit by $a_0$. Morever, $f(t)=0$ for all $a\le t\le a_0$ and moreover there is a sequence $t_n\to a_0$, $t_n>a$ with $|f(t_n)|>0$. By the above, $a_0>a$. Now, for all $x>a_0$ there holds
$$|f(x)|\le K\int_a^x |f(t)| dt = K\int_{a_0}^x |f(t)| dt.$$
We define $x_\varepsilon^0:=\inf \{x>a_0:|f(x)|\ge \varepsilon\}$. Since $f(t)=0$ for all $t\le a_0$ we have that
$$\varepsilon \le f(x^0_\varepsilon) \le K\int_a^{x^0_\varepsilon}|f(t)|dt=K\int_{a_0}^{x^0_\varepsilon}|f(t)|dt \le K(x_\varepsilon^0-a_0)\varepsilon$$
thus we deduce that $x_\varepsilon^0\ge \frac{1}{K}+a_0$. $x_\varepsilon^0$ again converges for $\varepsilon\to0$, and this time we can guarantee, that the limit is $a_0$ (because $|f(t_n)|>0$), a contradiction to the above lower bound.
A: Here's a very similar approach, not sure how rigorous it is

*

*Prove that $g(a) = 0$
$$g(a) \leq K \int_{a}^{a}g(x)dx = 0$$


*Choose a very small distance $\epsilon$
$$g(a + \epsilon) \leq K \int_{a}^{a + \epsilon}g(x)dx
\approx \epsilon K \frac{g(a) + g(a + \epsilon)}{2} + O(\epsilon^2)$$
Rearranging and setting $g(a) = 0$ we get
$$O(\epsilon^2) \geq g(a + \epsilon)(2 - \epsilon K)$$
For sufficiently small $\epsilon$ this is only possible if $g(a + \epsilon) = 0$.


*The same argument holds for all points $(a, a + \epsilon]$, so they are all zero.


*Shift the start if the integral $a \rightarrow a + \epsilon$ and continue doing steps 2 and 3 iteratively until we prove that all of the interval is zero.
The only problem I see with this proof is that maybe there exist some very weird functions for which point 2. does not hold for very small but finite intervals. I'm thinking about something like the Weierstrass function, but that is far beyond my understanding
