The statement of the question is not entirely correct. In fact the integrating factor for equation
$$Mdx+Ndy=0$$
where $M$ and $N$ are homogeneous functions of both $x$ and $y$ (i.e. $M(x,y)=x^m M(1,\frac{y}{x})$, see Gerry Myerson's comment for an example) will be
$$\mu = \frac{1}{Mx+Ny}$$
in order to ascertain this divide both sides of your equality by $Mx+Ny$:
$$\frac12d(\ln(xy))+\frac12\frac{Mx-Ny}{Mx+Ny}d(\ln(x/y))=\frac{Mdx+Ndy}{Mx+Ny}$$
$$\frac12d(\ln(xy))+\frac12\frac{M(x,y)\frac{x}{y}-N(x,y)}{M(x,y)\frac{x}{y}+N(x,y)}d(\ln(x/y))=\frac{Mdx+Ndy}{Mx+Ny}$$
Using homogeneity:
$$\frac12d(\ln(xy))+\frac12\frac{M(\frac{x}{y},1)\frac{x}{y}-N(\frac{x}{y},1)}{M(\frac{x}{y},1)\frac{x}{y}+N(\frac{x}{y},1)}d(\ln(x/y))=\frac{Mdx+Ndy}{Mx+Ny}$$
On the LHS variables are separated, so it is effectively an exact differential (you can let $\frac{x}{y}=e^t$ to complete the form. Therefore, $\mu$ as given above is an integrating factor.
Constructive proof goes in a somewhat similar way. Let $u=\frac{x}{y}$. Then again, using homogeneity (assuming $M$ and $N$ are homogeneous of the order $m$):
$$M(x,y)=M(x,ux)=x^m M(1,u)$$
Similarly
$$N(x,y)=x^m N(1,u)$$
Now
$$dy=udx+xdu$$
Inserting in the original equation we obtain
$$x^m (M(1,u)+uN(1,u))dx+x^{m+1}N(1,u)du$$In order to separate variables we must divide both sides by $x^{m+1}(M(1,u)+uN(1,u)$. However
$$\mu = \frac{1}{x^{m+1}(M(1,u)+uN(1,u)}=\frac{1}{x\cdot x^m(M(1,u)+y\cdot x^m N(1,u)}=\frac{1}{xM(x,y)+yN(x,y)}$$
An integrating factor, as you can check (!), is
$$f(x,y) = \frac1{xy(x^4y-3)}\,.$$
Where does this come from, you ask? By noting that the $1$-parameter group on $\mathbb R^2-\{0\}$
$$\{(x,y) \rightsquigarrow (e^t x, e^{-4t}y)\}$$
leaves the differential equation invariant. I was told years ago that it was exactly for the purposes of finding such obscure integrating factors that Sophus Lie "invented" Lie groups.
One then integrates and gets
$$\frac{3-x^4y}{xy} = C,$$
which is, indeed, $y=\dfrac3{x^4+Cx}$, as @Amzoti obtained.
Best Answer
Assume that there is an integrating factor of the form $\mu(xy)$. Then multiplying through by $\mu$ should make the equation $\mu M \; dx +\mu N \; dy =0$ exact. So we must have
$$\frac{\partial}{\partial y}(\mu M) = \mu M_y+x\mu 'M = \frac{\partial}{\partial x}(\mu N)=y\mu 'N+\mu N_x.$$
Solve for $\mu'$ to get:
$$\mu'(z) =(\mu M_y-\mu N_x)/(yN-Mx) = \mu (z)\frac{M_y-N_x}{Ny-Mx}.$$
If this last fraction (your $g$) is a function of $xy$, then such a $\mu (xy)$ exists and you can solve the separable differential equation for $\mu$:
$$\frac{\mu'}{\mu } = \frac{M_y-N_x}{Ny-Mx}=g(z)$$
$$\ln(\mu ) = \int g(z) \; dz$$
$$\mu = e^{\int g(z) \; dz}$$.
Just be sure to put everything in terms of $z$.
Note, the integrating factor you put in your question is for the case when $g$ is a function of $y$ alone. $\mu(x)$, $\mu (y)$ and $\mu (xy)$ are different cases and each has it's own formula.