As we know by the PNT tha primes have density $\frac{1}{\log x}$, so I am wondering whether we always have
$$ \sum_{p \leq x} f(p) \sim \int_1^x \frac{f(t)}{\log t} dt $$
I have varified it for $f(x) = \frac{1}{\log x}, \frac{1}{\log \log x}$ to get Mertens Theorem etc.
Is it the case for any $f$ (having the property as mentioned in title) or depend on growth of $f$?
Assume that $f'$ exists and is integrable. Using Abel's summation formula, $$ \sum\limits_{p \le x} {f(p)} = \pi (x)f(x) - \int_2^x {\pi (t)f'(t){\rm d}t} . $$ By the prime number theorem, $$ \pi (t) = \operatorname{Li}(t) + R(t) $$ where $\operatorname{Li}$ is the offset logarithmic integral and $R(t)$ is the error term. Thus, by integrating once by parts, \begin{align*} \sum\limits_{p \le x} {f(p)} & = \pi (x)f(x) - \int_2^x {\operatorname{Li}(t)f'(t){\rm d}t} - \int_2^x {R(t)f'(t){\rm d}t} \\ & = \int_2^x {\frac{{f(t)}}{{\log t}}{\rm d}t} + R(x)f(x) + \operatorname{Li}(2)f(2) - \int_2^x {R(t)f'(t){\rm d}t} . \end{align*} Consequently, if $$ R(x)f(x) + \operatorname{Li}(2)f(2) - \int_2^x {R(t)f'(t){\rm d}t} = o\!\left( {\int_2^x {\frac{{f(t)}}{{\log t}}{\rm d}t} } \right) $$ as $x\to+\infty$, then $$ \sum\limits_{p \le x} {f(p)} \sim \int_2^x {\frac{{f(t)}}{{\log t}}{\rm d}t} $$ as $x\to+\infty$.