How to find the critical index $a$ of $x^af(x)$? Let $f\in C^1(0,+\infty)$, $f(x)> 0$ in $(0,+\infty)$, $f(0+)=+\infty$, and $f$ is decrased in $(0,+\infty)$. Consider $g(x)=x^af(x)$, $(a>1)$. Now one can show that $\liminf_\limits{x\rightarrow0^+}g(x)=\limsup_\limits{x\rightarrow0^+}g(x)$, so we write $\lim_\limits{x\rightarrow0^+}g(x)>0$ to describe both $\lim_\limits{x\rightarrow0^+}g(x)=c>0$ and $\lim_\limits{x\rightarrow0^+}g(x)=+\infty$. Attention, for we only care about what happen near $x=0$，so we can weaken $(0,+\infty)$ to be $(0,\delta)$ and can smoothen $f$ with a smooth function when $x>\delta$.
Problem: Given the $f$ as above, define $g_a(x)=x^af(x)$,$ (a>1)$. If
(1) there exists $\alpha>1$ such that $\lim_\limits{x\rightarrow0^+}g_\alpha(x)>0$,
(2) there exists $\beta>\alpha$ such that  $\lim_\limits{x\rightarrow0^+}g_\alpha(x)=0$.
Please show that there exists $\gamma\in[\alpha,\beta)$ such that
(i) $\lim_\limits{x\rightarrow0^+}g_\gamma(x)>0$,
(ii) for any $\epsilon>0$, $\lim_\limits{x\rightarrow0^+}g_{\gamma+\epsilon}(x)=0$.
That is, can one find the "critical index"?
Attempt, example and some information: There are many examples for the proposition:
(a) $f(x)=\frac{1}{x^2}\ln(1+\frac{1}{x})$, then $\lim_\limits{x\rightarrow0^+}g_2(x)>0$ and $\lim_\limits{x\rightarrow0^+}g_3(x)=0$, we can find the "critical index" to be $a=2\in[2,3)$
(b) $f(x)=x^{-2+e^x}\ln(1+\frac{1}{x})$ satisfies our conditions in $(0,\text{small}~\delta)$. One can easily find out the "critical index" is $a=1$.
I think the difficulty of this problem is that "if $a$ make $\lim_\limits{x\rightarrow0^+}g_a(x)=0$, then can one show there exist a small $\epsilon>0$ such that $\lim_\limits{x\rightarrow0^+}g_{a-\epsilon}(x)=0$?". I can't show this can you help me? Or this proposition is wrong and you can find the counterexamples? But I want this proposition to be true, does it need to add any extra conditions for $f(x)$?
If you need you can add the condition $|f'(x)|\leq C \frac{f(x)}{x}$. In fact these conditions for $f$ is given by other propositions and theorem. I just summarized it.
2020/7/26 Addition (you can choose to answer or just have a look): One gives the counterexample in the answer, so if I still want this proposition to be correct I must add some conditions to $f$. In fact, this is relative to this problem: estimate a integral with parameter
The problem in the link is one example of a kind of integrals with parameter, if one puts $u=1/r$, then it become the problem here. So the $f$ here should be like $\frac{1}{x^m}(\text{log term, arctan term})$ (the example (a)(b) above), and $\frac{-1}{x^2\log x}$ will not appear. So what can I give the conditions to $f$ such that the proposition can be ture? (I discussed with my friends and we turns out that, it's difficult to describe straight $f$ have such type $\frac{1}{x^m}(\text{log term, arctan term})$, so we want a more general lemma to due with it. )
 A: (I don't know if this answers your question, but it can be an hint.)
You can define the function $\lambda\colon [1,+\infty)\to [0,+\infty]$ by
$$
\lambda(a) := \limsup_{x\to 0+} x^a f(x).
$$
Since $g_a > g_b$ if $a < b$, we clearly have that $\lambda$ is monotone non-increasing.
By assumption, $\lambda(\alpha) > 0$ and $\lambda(\beta) = 0$ for some
$1 < \alpha < \beta$.
Let
$$
\gamma := \inf\{a\geq 1:\ \lambda(a) = 0\}.
$$
This "critical" value $\gamma$ has the following properties:
(1) $\lambda(a) = +\infty$ for every $a < \gamma$;
(2) $\lambda(a) = 0$ for every $a > \gamma$.
On the other hand, I think that $\lambda(\gamma)$ can be every element of $[0,+\infty]$ (depending on the choice of $f$).
Some examples:
(1) If you take $f(x) = - \log(x) / x^2$, you have that $\lambda(a) = 0$ if $a > 2$ and $\lambda(a) = +\infty$ if $a \leq 2$.
In this case, $\gamma = 2$ and $\lambda(\gamma) = +\infty$.
(2) If you take $f(x) = - \frac{1}{x^2 \log x}$, then again $\gamma = 2$, but in this case $\lambda(\gamma) = 0$.
A: We have 2 conditions, where the first condition is the inequality
$$
|f'(x)|\leq C\frac{f(x)}{x}\tag{1}
$$
and the second condition is the limit saying that there exists a $\beta$ such that
$$
g_\beta(0^+)=0.\tag{2}
$$
Define the function
$$h_a(x)=x^af'(x)\tag{3}$$
then differentiate $g_a(x)$ once and use the definition (3) to get the equation
$$g'_a(x)=ag_{a-1}(x)+h_a(x).\tag{4}$$
Using inequality (1) with definition (3) we have
$$
|h_a(x)|\leq Cg_{a-1}(x)
$$
which for $a=\beta+1$ yields $h_{\beta+1}(0^+)=0$ which in turn we insert into equation (4) to obtain
$$
g'_{\beta+1}(0^+)=0.
$$
The idea is to decrease $a$ by one by one. We start with $a_0=\beta+1$ then we iterate with $a_n=\beta+1-n$ until we find first occurance of $g_{a_n}(0^+)>0$ which yields $\alpha=a_n<\beta$. It follows that $\gamma\in[\alpha,\alpha+1)$. To find $\gamma$ use some iterative method, such as interval halving starting with the interval $[\alpha,\alpha+1]$.
