Decomposition of differentiable function as a dot product? If $f:\mathbb{R}^n\to\mathbb{R}$ is a differentiable function with $f(0)=0$, then $f(\mathbf{x})=\mathbf{x}\cdot g(\mathbf{x})$ for some $g:\mathbb{R}^n\to\mathbb{R}^n$.
I tried adapting the proof of Euler's homogeneous function theorem, but couldn't figure out a similar equation for a not necessarily homogeneous $f$. The reason I did this is because the right hand side looks like the result of differentiating $f(\alpha\mathbf{x})$ w.r.t. $\alpha$, where $g(\mathbf{x})$ is $Df(\mathbf{x})$. Any suggestions?
 A: Let $x$ be fixed, and $\gamma_x:\mathbb{R} \to \mathbb{R}^n$ be given by $\gamma(t)=tx$. Then
$$f(x)=f(x)-f(0)=\int_0^1(f \circ \gamma_x)'=\int_0^1 \langle \nabla f \circ \gamma_x,x \rangle =\langle \int_0^1 \nabla f \circ \gamma_x , x\rangle .$$
Define then $g(x):=\int\limits_0^1 \nabla f \circ \gamma_x$.
EDIT: As @zhw points out, this assumes that $f$ is $C^1$ due to the usage of the FTC. In his answer, you can see a different approach which handles the general case (which even relies only on differentiability at $0$ if you don't impose conditions for $g$).
A: The answer of @AloizioMacedo works if $f$ is $C^1$ by the FTC, but we only know $f$ is differentiable. The following will work in the general case: By the definition of differentiability, we have
$$f(x) = x\cdot \nabla f(0) + r(x),$$
where $r(x)/|x| \to 0.$ Now write
$$r(x) = x\cdot x\frac{r(x)}{|x|^2}.$$
Then we have
$$f(x) = x\cdot \left ( \nabla f(0) + \frac{r(x)}{|x|^2}x\right).$$
Setting $g(x)$ equal to the expression inside the parentheses gives the desired result. Note that $g$ is differentiable on $\mathbb R^n \setminus \{0\}$ and is continuous at $0,$ but it's possible that $g$ is itself not differentiable at $0.$
