$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)$ I'm trying to solve the following exercise

Let $f: \mathbb{R^2} \to \mathbb{R}$ a $C^\infty$ function such that $f(x,0)=f(0,y)=0$ $\forall x,y \in \mathbb{R}$.
Then there exists a $C^\infty$ function $g:\mathbb{R^2} \to \mathbb{R}$ satisfying $f(x,y)=xy\, g(x,y)$ $\forall x,y \in \mathbb{R}$

I thought first about expanding $f$ using the taylor theorem, we would have $$f(x,y)=f(0,0)+f'(0,0)(x.y)+\frac{f''(0,0)(x,y)^2}{2!}+r(x,y),$$
but $f(0,0)=0$ and $f_x(0,0)=f_y(0,0)=0$ since $f$ is zero on the $x$ and $y$ axis.
$f''(0,0)(x,y)^2=f_{xx}(0,0)x^2+f_{xy}(0,0)xy+f_{yy}(0,0)y^2$, now we have a term that has a product of $x$ and $y$. But I don't know how (and if it is possible) to proceed from here.
 A: 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$.
A: 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.
A: Define $g(x,y)$ like this :
$x\neq 0 \land y \neq 0 : \frac{f(x,y)}{xy}=g(x,y) $
$g(0,y_0)=\lim_{(x,y) \to (0,y_0)} \frac{f(x,y)}{xy}$
$g(x_0,0)=\lim_{(x,y) \to (x_0,0)} \frac{f(x,y)}{xy}$
$g(0,0)=\lim_{(x,y) \to (0,0)}   \frac{f(x,y)}{xy} $
The above limits must exist. To show this we can use the fact that $f(x,y)$ is continuously differentiable. This means  : $\frac{\partial}{\partial x}f(x,y)=\lim_{h \to 0} \frac{f(x+h,y)-f(x,y)}{h}=\lim_{(x',y') \to (x,y)} \frac{f(x',y')-f(x,y')}{x'-x}$ , the last limit being independent of the chosen path. Making $\frac{\partial}{\partial x}f(x,y)$ a continuous function.
So for example let $y_0 \neq 0$ :
$ g(0,y_0) = \lim_{(x,y) \to (0,y_0)} \frac{f(x,y)}{xy}= 
 \lim_{(x,y) \to (0,y_0)} \frac{f(0+x,y)-f(0,y)}{xy}= 
 \lim_{(x,y) \to (0,y_0)} \frac{1}{y}\left[\frac{\partial}{\partial x}f(x,y)|_{(0,y_0)}\right]=\frac{1}{y_0} \frac{\partial}{\partial x}f(x,y)|_{(0,y_0)} 
$ 
Or:$ g(0,0) = \lim_{(x,y) \to (0,0)} \frac{f(x,y)}{xy}= 
 \lim_{(x,y) \to (0,0)} \frac{f(0+x,y)-f(0,y) -xf_x(x,0)}{xy}=  \lim_{(x,y) \to (0,0)} \frac{\frac{f(0+x,y)-f(0,y)}{x} -f_x(x,0)}{y}  =  \lim_{(x,y) \to (0,0)} \frac{f_x(x,y) -f_x(x,0)}{y} =\frac{\partial}{\partial y}\frac{\partial}{\partial x}f(x,y)|_{(0,0)} $

And we know that $f(x,y)$ is $C^\infty $ so the partial derivatives exist in $x,y=0$ . 
So the above definition gives a continuous function $g(x,y)$.

To prove $g(x,y)$ is $C^\infty$ in the limit $x,y \to 0$ we can use similar argument as above knowing that $f(x,y)$ is $C^\infty$ .

Example showing $g(x,y)$ is continuously differentiable using the fact that  $f(x,y)$ is $C^\infty$  :
$g_x(0,y)=\frac{\partial}{\partial x'}g(x',y')|_{(0,y)} = \lim_{(x',y') \to (0,y)} \frac{g(x',y')- g(0,y')}{x'} = \\$
$\lim_{(x',y') \to (0,y)} \frac{g(x',y')- \frac{1}{y'}f_x(0,y')}{x'} = \\$
$\lim_{(x',y') \to (0,y)} \frac{\frac{f(x',y')}{x'y'}- \frac{1}{y'}f_x(0,y')}{x'} = \\$
$\lim_{(x',y') \to (0,y)} \frac{\frac{f_x(x',y')\cdot x'}{x'y'}- \frac{1}{y'}f_x(0,y')}{x'}= \\$
$\lim_{(x',y') \to (0,y)} \frac{1}{y'}\frac{ f_x(x',y')  - f_x(0,y')}{x'}=\frac{1}{y}\frac{\partial^2}{\partial x'^2}f(x',y')|_{(0,y)}$
