Finding $g_i:\mathbb{R}^n\to\mathbb R$ s.t $f(x)=\sum\limits_{i=1}^nx_i\cdot g_i(x)$
Solution 1:
By the chain rule we shall have $$f'(tx)=\sum_{k=1}^n\frac{\partial f}{\partial x_k}(tx)x_k,$$ put $g_k(x):=\int_0^1 \frac{\partial f}{\partial x_k}(tx)dt.$ This is a form of Hadamard's lemma. I actually don't understand what you mean by your second question, which is very imprecise, but this lemma is used to prove, say, that every derivation of $C^\infty(\mathbf{R}^n)$ is a first order linear partial differential operator.