Well, if a complex-valued function $g$ satisfies $\dfrac{\partial}{\partial \bar z} g = 0$, we know that $\dfrac{\partial g}{\partial x} + i\dfrac{\partial g}{\partial y} = 0$ (nearly exactly from the definition of $\dfrac{\partial}{\partial \bar z}$) and so with a small bit of manipulation, we see that $i(\dfrac{\partial g}{\partial x} + i\dfrac{\partial g}{\partial y}) = i\dfrac{\partial g}{\partial x} - \dfrac{\partial g}{\partial y} = 0$ and $\dfrac{\partial g}{\partial y} = i\dfrac{\partial g}{\partial x}$.
This is an equivalent formulation of the Cauchy-Riemann equations, which tells us our function $g$ is holomorphic and equivalently analytic. In fact, a convenient test for holomorphicity is to check if $\dfrac{\partial}{\partial \bar z} = 0$. So we know that our function $f^2$ is holomorphic, but all polynomials (and their squares, of course) are naturally holomorphic! Hence we could have concluded $\dfrac{\partial}{\partial \bar z}f = 0$ from our original hypothesis. We have not actually constrained our function any further.
EDIT: Given your previous approach, a helpful fact to establish is that the product rule is valid for $\dfrac{\partial}{\partial \bar z}$. Then $\dfrac{\partial f^2}{\partial \bar z} = 2f\dfrac{\partial f}{\partial \bar z}$, and so if $\dfrac{\partial f^2}{\partial \bar z} = 0$ and our polynomial isn't $0$ everywhere, then $\dfrac{\partial f}{\partial \bar z} = 0$ and we can write $f$ solely in terms of $z$, hence we can do the same for $f^2$.