Is this true for a continuously differentiable function
Fix $x\in{\mathbb R}^n$ and consider the auxiliary function $$\phi(t):=f(t\,x)\qquad(0\leq t\leq 1)\ .$$ The chain rule then gives $$f(x)=\phi(1)-\phi(0)=\int_0^1\phi'(t)\>dt=\int_0^1\nabla f(t\,x)\cdot x\>dt=\sum_{i=1}^n x_i\,g_i(x)$$ with $$g_i(x):=\int_0^1 f_{.i}(t\, x)\>dt\qquad(1\leq i\leq n)\ .$$