Symmetry in ordinary differential equations Suppose I am  given an ode $${dy\over dx}={1\over x^2}f(xy)$$ where $f$ is some arbitrary function.

How then does doing the following help solve the equation? :

First I have a vector field $$V=x\partial_x-y\partial_y$$

I see that this corresponds to the transformation $$(x,y)\to (x\exp(p), y\exp(p))$$ where $p$ is a parameter.

Then I sought invariant coordinates $q_1,q_2$ of the vector field such that $$V(q_1)=1, V(q_2)=0$$

In this case I could take $q_1=xy$ and $q_2=\log|x|$. Though there might be other choices that are more suitable?

Please help!
The vector V is one of the Lie point symmetries of the ODE. By knowing the maximal Lie algebra you can use other choices too. Also, because of the existence of the arbitrary function f(x,y), by group classification, you can find specific forms of the function f that give more symmetries and more integrating factors.
Sorry, I couldn't follow your hint. So here is a different idea which hopefully simplify the original equation.
$$
u(x):=x\,y(x)$.
$$
Then
$$
y(x)=\frac{u(x)}{x},
$$
so we obtain
$$
u'x-u=f(u).
$$
From this
$$
\frac{du}{dx}x=u+f(u),
$$
consequently
$$
\frac{1}{u+f(u)}du=\frac{1}{x}dx,
$$
if $f(u)\neq -u$. (If it is, then $\frac{du}{dx}x=0$, and thus $u$ is a constant function.) Now integrating both sides we get
$$
\int \frac{1}{u+f(u)}du=\ln(|x|).
$$