Suppose $n$ is a positive integer. Let $f(n)$ denote the largest size of a subset $T$ of $\{1, 2, ..., n\}$ such that $T$ does not contain any two elements $a, b$ whose product $ab$ is a perfect square.
Question. What are some nontrivial lower and upper bounds on $f(n)$?
It is clear that $f(n)\geq \pi(n)$, where $\pi(n)$ denotes the number of prime numbers up to $n$. After all, we can take $T=\{p_1, p_2, ..., p_{\pi(n)}\}$ to be the list of first primes up to $n$. Then, no two elements of $T$ has a product which is a perfect square. Is there a nice way to improve the lower bound?
What about upper bounds on $f(n)$? One idea: we can observe that by the pigeonhole principle (applied to the exponents modulo $2$), any set of $2^{m}+1$ positive integers all of whose prime factors belong to the set $\{p_1, ..., p_{m}\}$ must contain a pair $a$ and $b$ such that $a\cdot b$ is a perfect square. Maybe this can help with obtaining some kind of upper bound, but I have not been able to make it work. In any event, I would love to see other approaches for the upper bound.