Transformation in PDE Using the transformation $\displaystyle u=\frac{w}{y}$ in the PDE:
$$x\frac{du}{dx} = u + y\frac{du}{dy}$$
 The transformed equation has a solution of the form
"$w=?$".

What is the method to solve such question? 

I substituted $\displaystyle u=\frac{w}{y}$ in the equation and then tried to solve. I got:
$$-x\frac{w}{y^2} \frac{dy}{dx} = u - \frac{w}{y}$$
Is this correct?
What you got : $\quad -x\frac{w}{y^2} \frac{dy}{dx} = u - \frac{w}{y}\quad $
 is not correct.

Since you didn't show the detail of your calculus, it's not possible to show you where is the mistake. I suppose that you can find the correct result by yourself.  Or show us what you have done.

For this PDE the method of change of function is very good. Even simpler, use the change $u(x,y)=xv(x,y)$.

For information only, another method method is shown below (method of characteristics) :

The equations of characteristics curves are : $\quad \frac{dx}{x}=-\frac{dy}{y}=\frac{du}{u}\quad\to\quad \begin{cases}xy=c_1 \\ \frac{u}{x}=c_2\end{cases}$

This is valid with independent $c_1$ and $c_2$  on the characteristic curves only. Elsewhere $c_1$ and $c_2$ are dependent : $c_2=f(c_1)$. So, the general solution of the PDE is :

$$u=xf(xy)$$
with any differentiable function $f$.
What you got : $\quad -x\frac{w}{y^2} \frac{dy}{dx} = u - \frac{w}{y}\quad $
 is not correct.

Since you didn't show the detail of your calculus, it's not possible to show you where is the mistake. I suppose that you can find the correct result by yourself.  Or show us what you have done.

For this PDE the method of change of function is very good. Even simpler, use the change $u(x,y)=xv(x,y)$.

For information only, another method method is shown below (method of characteristics) :

The equations of characteristics curves are : $\quad \frac{dx}{x}=-\frac{dy}{y}=\frac{du}{u}\quad\to\quad \begin{cases}xy=c_1 \\ \frac{u}{x}=c_2\end{cases}$

This is valid with independent $c_1$ and $c_2$  on the characteristic curves only. Elsewhere $c_1$ and $c_2$ are dependent : $c_2=f(c_1)$. So, the general solution of the PDE is :

$$u=xf(xy)$$
with any differentiable function $f$.