So i was trying to prove the following:
Let $f \colon \mathbb{R}^n \rightarrow \mathbb{R}^m $, $g \colon \mathbb{R}^m \rightarrow \mathbb{R}^k $ and $h \colon \mathbb{R}^n \rightarrow \mathbb{R}^k $ such that $h = g \circ f$. If $f$ is differentiable a t $p \in \mathbb{R}^n$ and $g$ is differentiable at $q = f(p) \in \mathbb{R}^m$ then $h$ is differentiable at $p$ and $Dh(p) = Dg(q) \circ Df(p)$
My attempt: As $f$ is differentiable at $p$ and $g$ so it is at $q$, we have
\begin{align*} f(x) &= f(p) + Df(x - p) + R_f(x),\text{ with }\frac{\Vert R_f(x)\Vert}{\Vert x-p\Vert} \rightarrow 0\text{ as } x \rightarrow p \\ g(x) &= g(q) + Dg(x - q) + R_g(x),\text{ with }\frac{\Vert R_g(x)\Vert}{\Vert x-q\Vert} \rightarrow 0\text{ as } x \rightarrow q \end{align*} Then, \begin{align*} h(x)&= g(f(x)) = g(f(p)) + Dg(f(x) - f(p)) + R_g(f(x)) \\ &= g(f(p)) + Dg(Df(x-p) + R_f(x)) + R_g(f(x)) \\ &= (g \circ f)(p) + (Dg \circ Df)(x-p) + Dg(R_f(x)) + R_g(f(x))\end{align*}
If $R(x) = Dg(R_f(x)) + R_g(f(x))$, proving $\frac{\Vert R(x)\Vert}{\Vert x - p\Vert} \rightarrow 0$ as $x \rightarrow p$ would be enough to complete the proof.
\begin{align*} \frac{\Vert R(x)\Vert}{\Vert x - p\Vert} = \frac{\Vert Dg(R_f(x)) + R_g(f(x))\Vert}{\Vert x - p\Vert} \leq \frac{\Vert Dg(R_f(x))\Vert}{\Vert x - p\Vert} + \frac{\Vert R_g(f(x))\Vert}{\Vert x - p\Vert} \end{align*}
So, i need to bound both terms. For the first one, i was thinking of $\frac{\Vert Dg(R_f(x))\Vert}{\Vert x - p\Vert} \leq \frac{\Vert D_g\Vert \Vert R_f(x)\Vert}{\Vert x - p\Vert} \leq \frac{\Vert D_g + \epsilon_1 \Vert \Vert R_f(x)\Vert}{\Vert x - p\Vert}$ for some $\epsilon_1 > 0$, and thus, taking $\delta_1 > 0$ such that $\frac{\Vert R_f(x)\Vert}{\Vert x - p\Vert} < \frac{\epsilon_2}{2(\Vert Dg + \epsilon_1\Vert)}$ if $\Vert x - p\Vert < \delta_1$ so $\frac{\Vert D_g + \epsilon_1 \Vert \Vert R_f(x)\Vert}{\Vert x - p\Vert} \leq \frac{\epsilon_2}{2}$ if $\Vert x - p \Vert < \delta_1$.
Yet, i don't know how to bound the second term. Any help? Thanks in advance.
It the proof is convenient to express the remainders in Peano's form
Then
$$h(x)= g(f(x)) = g(f(p)) + Dg(f(x) - f(p)) + R_g(f(x))$$
with
$$R_g(f(x))=\Vert f(x)-f(p)\Vert \cdot\omega_g(f(x)-f(p))$$
thus
$$h(x)= g(f(x)) = g(f(p)) + Dg(f(x) - f(p)) + \Vert f(x)-f(p)\Vert \cdot\omega_g(f(x)-f(p))$$
$$= g(f(p)) + Dg(Df(x-p) + \Vert x-p\Vert \cdot\omega_f(x-p)) + \Vert f(x)-f(p)\Vert \cdot\omega_g(f(x)-f(p))$$
$$= (g \circ f)(p) + (Dg \circ Df)(x-p) + Dg(R_f(x)) + R_g(f(x))$$
where
and finally we obtain
$$\frac{|Dg(R_f(x))|}{\Vert x-p\Vert}\le |Jg||(\omega_f(x-p))|\to0$$
$$\frac{|R_g(f(x))|}{\Vert x-p\Vert}=\frac{\Vert f(x)-f(p)\Vert}{\Vert x-p\Vert} \cdot |\omega_g(f(x)-f(p))|\to 0$$