I think the
The OP's conjecture follows from theorem 1.1 in "Primes with an average sum of digits" by Drmota, Mauduit and Rivat. They prove that the number of primes $\le x$ with $k$ binary digits is given by $$\frac{\pi(x)}{\sqrt{(\pi/2) \log x }}\left(e^{-\frac{2(k-\frac{1}{2}\log x)^2}{\log x}}+O(\log x^{-\frac{1}{2}+\epsilon})\right).$$ So inparticular this shows the stronger result in your question corresponding to the function $f(n)=\alpha \sqrt{n}$. (So one has infinitely many primes with $\frac{n}{2}+\alpha\sqrt{n}$ ones in their binary expansion.) The authors say that they weren't able to get any bounds for $f(n)=\alpha n$ with any $\alpha > 0$.

