Sum of reciprocal prime numbers

Apostol gives a proof of this in his book. Here's a more-or-less condensed version:

Letting $[p]$ be an Iverson bracket ($1$ if condition $p$ is true, and $0$ if $p$ is false), we have $\sum\limits_{p \le n}\frac1{p}=\sum\limits_{k \le n}\frac{[k\in\mathbb P]}{k}$ Introduce the function $\ell(n)=\sum\limits_{p \le n}\frac{\log\,p}{p}=\sum\limits_{k \le n}\frac{[k\in\mathbb P]\log\,k}{k}$. Making use of (a special case of) Abel's identity,

$$\sum_{y < n \le x}\frac{a(n)}{\log\,n}=\frac{A(x)}{\log\,x}-\frac{A(y)}{\log\,y}+\int_y^x \frac{A(t)}{t(\log\,t)^2}\mathrm dt$$

where for this case $a(n)=\frac{[n\in\mathbb P]\log\,n}{n}$ and $A(x)=\sum\limits_{k \le x}a(k)$. Taking $y=2$, we have

$$\sum_{p \le n}\frac1{p}=\frac{\ell(n)}{\log\,n}+\int_2^n \frac{\ell(t)}{t(\log\,t)^2}\mathrm dt$$

Since $\ell(n)=\log\,n+O(1)$, we then have

$$\begin{align*}\sum_{p \le n}\frac1{p}&=1+O\left(\frac1{\log\,n}\right)+\int_2^n \frac1{t\log\,t}\mathrm dt+\int_2^n \frac{\mathfrak{R}(t)}{t(\log\,t)^2}\mathrm dt\\&=1+O\left(\frac1{\log\,n}\right)+\log\log\,n-\log\log\,2+\int_2^n \frac{\mathfrak{R}(t)}{t(\log\,t)^2}\mathrm dt\end{align*}$$

where $\mathfrak{R}(t)=O(1)$. Since

$$\int_2^n \frac{\mathfrak{R}(t)}{t(\log\,t)^2}\mathrm dt=\int_2^\infty \frac{\mathfrak{R}(t)}{t(\log\,t)^2}\mathrm dt+O\left(\frac1{\log\,n}\right)$$

making the appropriate replacements gives

$$\sum_{p \le n}\frac1{p}=\color{blue}{1-\log\log\,2+\int_2^\infty \frac{\mathfrak{R}(t)}{t(\log\,t)^2}\mathrm dt}+\log\log\,n+O\left(\frac1{\log\,n}\right)$$

where the blue part is the constant term $C$ in the OP.