Show that if $f(x)$ tends to zero monotonically as $x$ increases without limit and is continuous for $x>0$ and if $\displaystyle \sum_{k=1} ^{\infty} f(k)$ diverges then $ \displaystyle \sum_{k=1} ^{n} f(k) \sim \int _1 ^n f(x) dx$.
(We write $f(x) \sim g(x)$ if $\displaystyle \lim_{x\to \infty} \frac{|f(x)|}{g(x)} < M$).
This is a problem in Leveque's Number Theory that I am stuck on. In the section corresponding to this problem, there is a theorem discussed that mentions $\displaystyle \sum_{k=1}^n \frac{1}{k} = \log n + \gamma + O(1/n)$ , where $\gamma$ is Euler's constant. I am not sure if this would help conclude the problem. Any suggestions?
EDIT: Part of the problem statement got chopped. I will add it here. If $g(x)$ is a second function satisfying the same hypotheses as $f(x)$ and if $g(x) = o(f(x))$ show that $\sum_{k=1}^n g(k) = o \left( \sum_{k=1}^n f(k) \right)$
(We write $f(x) = o(g(x))$ if $\displaystyle \lim_{x\to \infty} \frac{f(x)}{g(x)} = 0$).
Without loss of generality we may assume that $f(x)\ge 0$ on $(1,\infty )$.
Note that in that case $f(x)$ is decreasing on $ (1,\infty)$ and $$ f(2)+f(3)+...+ f(n) \le \int _1 ^n f(x) dx \le f(1)+f(2) + f(3) +...+f(n-1)$$
As $n\to \infty $ we get $$\displaystyle \sum_{k=2} ^{\infty} f(k)\le \int _1 ^{\infty} f(x) dx \le\displaystyle \sum_{k=1} ^{\infty} f(k)$$
Thus the infinite sum and the integral have the same behaviour.