Why must $f$ be non-negative and $f'$ be negative? The following is the Theorem 6.17 of the book Apostol's Analytic Number Theory:

My question is that I don't understand why is it necessary for $f$ to be a non-negative function and $f'$ to be negative for all $x\ge x_0$? (esp. it has not been supposed the function to be non-negative in Abel's identity, i.e. Theorem 4.2)  
 A: The reason why $f'$ is to be negative is for the integral bound
$$ - \int_x^y A(t) f'(t) dt \ll \int_x^y (-f'(t))dt. \tag{1}$$
If, for instance, $\chi(n) = (-1)^{n+1}$ is the nonprincipal character modulo $2$ and we took $f(x)$ to be something like $f(x) = \cos(\pi x) + 1$ (which is nonnegative but with oscillating derivative) then
$$ \sum_{n \leq X} \chi(n) f(n) \approx -X/2.$$
This is not bounded by $f(X)$ and as $X \to \infty$, it does not converge.
In the bounding of $(1)$, one probably appeals to the integral mean value theorem. Recall that if $m \leq h(x) \leq M$ and $g$ is nonnegative, then
$$ m \int_a^b g(x) dx \leq \int_a^b h(x)g(x) dx \leq M \int_a^b g(x) dx.$$
This is really just a simple application of the intermediate value theorem, but it rests pivotally on $g$ not changing signs here.
In the bounding of $(1)$, we apply the integral mean value theorem with $h = A(t)$ and $g = -f'(t)$.
The reason why $f$ is to be nonnegative is because the result is stated in terms of $O(f(x))$, which does not make sense if $f$ is negative.
A: In the use of Abel's identity the author makes use of  the estimate
$$\left|\int_x^y A(t) f'(t)dt\right|\leq \sup|A| \int_x^y  |f'(t)|dt=C\int_x^y  (-f'(t))dt= C(f(x)-f(y))$$
For the middle we need $f'$ non positive. And finally we want to take the $y\rightarrow \infty$ limit so we want that $f(y)=O(f(x))$ for all $y>x$. This is best achieved if $f$ is positive.
