$f: \mathbb{R^2} \to \mathbb{R}$ a $C^\infty$ function such that $f(x,0)=f(0,y)=0$ then exists $g$ such that $f(x,y)=xy\, g(x,y)$
Solution 1:
We are expanding the hint by zhw. \begin{align} f(x, y) &= f(x, y) - f(0,0) \\ &= \int_0^1 \frac{d}{dt} f(tx, ty)\, \mathrm dt \\ &= \int_0^1 \left( x f_x (tx, ty) + y f_y (tx, ty) \right)\, \mathrm dt \\ &= x\int_0^1 f_x (tx, ty) \, \mathrm dt + y \int_0^1 f_y (tx, ty) \, \mathrm dt \end{align}
Since $f(x, 0) = 0$, $f_x(tx, 0) = 0$. Thus
\begin{align} \int_0^1 f_x (tx, ty)\, \mathrm dt &= \int_0^1 (f_x (tx, ty) - f_x(tx,0)) \,\mathrm dt \\ &= \int_0^1 \int_0^t \frac{d}{ds} f_x (tx , sy)\, \mathrm ds\, \mathrm dt \\ &= y \int_0^1 \int_0^t f_{xy} (tx, sy) \, \mathrm ds\, \mathrm dt \\ &:= y g_1(x, y) \end{align}
Similarly, using $f(0, y) = 0$, $f_y(0, ty) = 0$. Thus
$$ \int_0^1 f_y (tx, ty)\, \mathrm dt = x \int_0^1 \int_0^t f_{yx} (sx, ty) \, \mathrm ds\, \mathrm dt := x g_2(x, y).$$
Since $f$ is smooth, it is clear that $g_1, g_2$ are smooth. Thus $$ f(x, y) = xy g(x, y)$$
with $g = g_1 + g_2$.
Solution 2:
Here's a hint for a nice way to do this. First, go back to one variable. Suppose $f\in C^\infty(\mathbb R)$ and $f(0)= 0.$ Is it true that $f(x) = x g(x),$ where $g\in C^\infty(\mathbb R)?$ Yes. Here's the proof:
$$f(x) = f(x) - f(0) = \int_0^x f'(t)\,dt = x\int_0^1 f'(xs)\,ds.$$
Now verify that $x\to \int_0^1 f'(xs)\,ds$ is in $\mathbb C^\infty(R),$ which is is relatively straightforward.
See if you can make this idea work in the setting of the given higher-dimensional problem.