The question can be equated to the counting of solutions to the following diophantine equation:
$$4a^4x^2\pm y^2=\Delta_f,$$ where $\Delta_f=b^2-4a^2c$ and plus\minus relate to considering when $f(x)=-\square$ or $\square$. Thus we have a Ramanujan–Nagell type equation.

In the special case when $a=1$ more can be said. In particular, for counting negatives squares, there are known formulas for the [$r_2(\Delta_f)$](http://mathworld.wolfram.com/SumofSquaresFunction.html).