Just to spark your curiosity, I'll prove you an elementary lower bound on $\pi(m)$ on the name of the community, as this does not answer the question. Essential theorem used here: every number $n$ is of the form $ab^2$ with squarefree $a$. Check for yourself using FTA that $a=p_1p_2\cdots p_k$, so no squares of primes appear in $a$. You can see this intuitively when considering $\sqrt{n}$, it is always of the form $b\sqrt{a}$.
That said, choose $x$ from the set $S=\{1,2,3,4,\ldots, m\}$ such that $1\leqslant x=ab^2\leqslant m$, with $a$ squarefree. Clearly, we have $m$ possiblilities to choose $x$. That's fine; now, we'll restrict the number of possible $a$'s and $b$'s we can choose. We will show that there are at most $2^{\pi(m)}$ such $a$'s and at most $\sqrt{m}$ such $b$'s.
We know we have $\pi(m)$ primes between $1$ and $m$. Therefore, $a$ is of the form $p_1^{\varepsilon_1}p_2^{\varepsilon_2}p_3^{\varepsilon_3}p_4^{\varepsilon_4}\cdots p_{\pi(m)}^{\varepsilon_{\pi(m)}}$, where $\varepsilon_k$ is either $0$ or $1$ depending or whether $p_k$ appears in the prime factorization of $a$. We see, then, that there are $2^{\pi(m)}$ such possible $a$'s to choose. And how many $b$'s? The key restriction is that $b\leqslant\sqrt{m}$, since $a\geqslant 1$.
So we can choose at most $2^{\pi(m)}$ possible $a$'s and $\sqrt{m}$ possible $b$'s to form $x=ab^2\leqslant m$. However, not all the numbers formed are smaller than $m$, some might exceed it. Nevermind that now; we may refine that later.
That way, we establish $m\leqslant 2^{\pi(m)}\sqrt{m}$. Now, manipulate to get $$\sqrt{m}\leqslant 2^{\pi(m)}\implies m\leqslant 2^{2\pi(m)}\implies\log_2(m)=\frac{\log(m)}{\log(2)}\leqslant 2\pi(m)\\\implies\frac{\log(m)}{2\log(2)}\leqslant \pi(m).$$
This might not be groundbreaking, but now you know a proof involving $\pi(x)$ and logarithms, so hey, them don't seem unrelated after all. There is a whole class of elementary proofs bounding $\pi(x)$ using combinatorics and related techniques, you can see them in books like Hardy and Wright's or Ireland and Rosen's.