Applying the fundamental theorem of calculus 
If $f:\mathbb{R}^n \to \mathbb{R}$ is differentiable and $f(0)=0$, prove that exist continuous $g_i:\mathbb{R}^n \to \mathbb{R}$ such that $$f(x)=\sum_{i=1}^{n} x_i g_i(x).$$
  Hint. Write $f(x)-f(0)=f(tx)|_{t=0}^1$ and apply the fundamental theorem of calculus.

It says apply the fundamental theorem of calculus? but how do i do it exactly?
 A: Assuming $f$ is continuously differentiable, we introduce, for each $x$, the function $g:\mathbb{R}\longrightarrow\mathbb{R}$
$$
g:t\longmapsto f(tx). 
$$
By composition, this is continuously differentiable and
$$
g'(t)=df_{tx}(x)=\sum_{j=1}^n \frac{\partial f}{\partial x_j}(tx)x_j.
$$
By the fundamental theorem of calculus
$$
f(x)=f(x)-f(0)=g(1)-g(0)=\int_0^1g'(t)dt=\int_0^1 df_{tx}(x)dt
$$
$$
=\sum_{j=1}^n\left(\int_0^1 \frac{\partial f}{\partial x_j}(tx)dt \right)x_j.
$$
Now set
$$
g_j(x):=\int_0^1 \frac{\partial f}{\partial x_j}(tx)dt.
$$
It remains to show that each $g_j$ is continuous. We could use a theorem like: if $h(x,t)$ is continuous on $\mathbb{R}^n\times \mathbb{R}$, then 
$$
H:x\longmapsto \int_0^1h(x,t)dt
$$
is continuous on $\mathbb{R}^n$. This follows easily from Lebesgue dominated convergence theorem. But we will give an elementary proof.
Write 
$$
|g_j(x)-g_j(y)|=\lvert \int_0^1 \frac{\partial f}{\partial x_j}(tx)- \frac{\partial f}{\partial x_j}(ty)dt\rvert\leq \int_0^1 \lvert\frac{\partial f}{\partial x_j}(tx)- \frac{\partial f}{\partial x_j}(ty)\rvert dt.
$$
Now fix $x$ and consider the compact set 
$$
K=\{(t,y)\;;\; 0\leq t\leq 1,\; \|x-y\|\leq 1\}.
$$ 
Since 
$$
(t,y)\longmapsto \frac{\partial f}{\partial x_j}(ty)
$$
is continuous on $K$ compact, it is uniformly continuous on $K$.
Now take $\epsilon>0$. By uniform continuity, there exists $\delta>0$ such that
$$
\lvert\frac{\partial f}{\partial x_j}(tx)-\frac{\partial f}{\partial x_j}(ty)\rvert\leq \epsilon
$$
for all $t\in[0,1]$ and all $\|x-y\|\leq \delta$.
For these $y$, we get
$$
|g_j(x)-g_j(y)|\leq \int_0^1\epsilon dt =\epsilon.
$$
So $g_j$ is continuous at $x$.
