I am working on computing the resolvent set of an operator. While I have the result I need, my proof is more complex than I would like to. If the result below would be true, that would short-cut my work quite a bit.
Hopeful result: If $f(x)\in L^2(\mathbb{R}^+)$ is continuous everywhere is such that $f(x)/\left(x^{1-\epsilon}\right)\in L^2(\mathbb{R}^+)$ for all $\epsilon>0$, then $f(x)/x\in L^2(\mathbb{R}^+)$.
Other things I know about $f$ in case it helps: $$ \lim_{x\rightarrow 0^+}\left(f(x)/(x^{1/2})\right)=0,{\text{ and }}f(x)\in H^1(a,\infty){\text{ for all }}a>0.$$
This is not true. The key problem is close to the origin. For $x\in (a,\infty)$ we have
$$ \vert f(x)/x\vert = x^{-\varepsilon} \vert f(x)/x^{1-\varepsilon}\vert \leq a^{-\varepsilon} \vert f(x)/x^{1-\varepsilon}\vert, $$
thus, $f(x)/x \in L^2((a,\infty))$ for all $a>0$.
In order to see that integrability can fail under the listed conditions consider a function such that for $x\in (0,1/2)$ we have $f(x)=x^{1/2}/\vert\ln(x)\vert^{1/2}$. Then we have
$$ f(x)/x^{1-\varepsilon} = \frac{1}{x^{1/2-\varepsilon} \vert\ln(x)\vert^{1/2}} $$ which is in $L^2((0,1/2))$ for all $\varepsilon>0$. Also
$$ \lim_{x\rightarrow 0^+} \frac{f(x)}{x^{1/2}} = \lim_{x\rightarrow 0^+} \frac{1}{\vert\ln(x)\vert^{1/2}} =0. $$
Also we have $f(x)/x \in C^\infty((0,1/2))$, thus, $f(x)/x \in H^k((a,1/2))$ for all $a\in (0,1/2)$ and all $k\in \mathbb{N}$.
However, we have with the change of variable $y=\ln(x)$
$$ \int_0^{1/2} \frac{\vert f(x)\vert^2}{x^2} dx= \int_{0}^{1/2} \frac{1}{x \vert \ln(x)\vert} dx = \int_{-\infty}^{-\ln(2)} \frac{1}{\vert y\vert} dy = \infty. $$
In order to make this a real counterexample, pick your favourite smooth function $\chi\in C^\infty(\mathbb{R}_+)$ such that $\chi(x)=1$ on $(0,1/4)$ and $\chi(x)=0$ for $x\in (1/2,\infty)$ and consider $f(x)=x^{1/2} \chi(x)/\ln(x)^2$.