How do I prove that $$\sum_{i=2}^{M}\frac{\pi(x^{1/i})}{i}=O(x^{1/2})+O(Mx^{1/3}).$$
I tried to use Prime Number theorem for $\pi(x)$ and then approximating the summation by integral, but when I used partial integration, the integral became too complicated and I couldn't get a bound.
Can any one give any hints on how to solve this?
We don't even need the prime number theorem for this. Trivially, we have that $\pi(x)\leq x,$ so $$\sum_{i=2}^{M}\frac{\pi\left(x^{1/i}\right)}{i}\leq\sum_{i=2}^{M}\frac{1}{i}x^{\frac{1}{i}}$$
$$\leq\frac{1}{2}x^{1/2}+x^{1/3}\sum_{i=3}^{M}\frac{1}{i}x^{1/i-1/3},$$ and since $1/i-1/3\leq0$ for $i\geq3,$ we have the inequality $$\sum_{i=2}^{M}\frac{\pi\left(x^{1/i}\right)}{i}\leq\frac{1}{2}x^{1/2}+x^{1/3}\sum_{i=3}^{M}\frac{1}{i}.$$ From here, we immediately obtain your inequality, but notice that by using the upper bound $\sum_{i=1}^{n}\frac{1}{i}\ll\log n$ , we could replace $M$ by $\log M.$
Additional Remarks: Using Chebyshevs upper bound, or equivalently the upper bound from the prime number theorem, we could obtain a factor of $\log x$ in the denominator as well. Note as well that the function you are looking at is a truncated version of Riemann's $\Pi(x)$, which we may define as $$\Pi(x)=\sum_{n=1}^\infty \frac{1}{n}\pi\left(x^{1/n}\right).$$