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?
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$).