Assume $f(n)$ is defined over the positive integers with $$\sum_{1}^x f(n) \sim xg(x),$$ where $g$ is a differentiable function with $xg'(x) = o(g(x))$. I am having trouble showing that
$$\sum_1 ^x \frac{f(n)}{g(n)} \sim x .$$
This doesn't seem to work for any differentiable function $g$ with the specified conditions, shouldn't $g$ also be positive? If so, how can we prove this statement?
Sketch: As a heuristic step, let us consider the continuous case. Suppose \begin{align} \int^x_0 f(s)\ ds= xg(x) \end{align} then we see that \begin{align} f(x) = xg'(x)+g(x). \end{align} Then it follows \begin{align} \frac{f(x)}{g(x)} = 1+ \frac{xg'(x)}{g(x)} \end{align} which means \begin{align} \int^x_0 \frac{f(s)}{g(s)}\ ds = x+\int^x_0 \frac{s g'(s)}{g(s)}\ ds \sim Cx. \end{align} I have used the fact that when $x$ is sufficiently large \begin{align} \left|\frac{xg'(x)}{g(x)} \right| \leq \frac{1}{2}. \end{align}
Now, make this work for the discrete case by using the Euler-Maclaurin formula.