By definition of the partial derivative of a function we treat all variables as constant except for one. Hence the proof of the first formula can be reduced to the proof of the second one. The general proof is quite tedious, so we only illustrate the main ideas if \(N=2\text{.}\) We need to compute the limit as \(h\to 0\) of
\begin{equation*}
D(h):=\frac{1}{h}\bigl(f(g_1(t+h),g_2(t+h))-f(g_1(t),g_2(t))\bigr)\text{.}
\end{equation*}
To do so we rewrite the expression as
\begin{align*}
D(h)\amp =\frac{f(g_1(t+h),g_2(t+h))-f(g_1(t),g_2(t+h))}{g_1(t+h)-g_1(t)}\quad\frac{g_1(t+h)-g_1(t)}{h}\\
\amp \qquad+\frac{f(g_1(t),g_2(t+h))-f(g_1(t),g_2(t))}{g_2(t+h)-g_2(t)}\quad \frac{g_2(t+h)-g_2(t)}{h}
\end{align*}
adding and subtracting a term. As \(g_i\) is differentiable at \(t\) it follows that
\begin{equation*}
\lim_{h\to 0}\frac{g_i(t+h)-g_i(t)}{h}
=g_i'(t)
\end{equation*}
for \(i=1,2\text{.}\) As a differentiable function of one variable is continuous, we have that \(g_i(t+h)-g_i(t)\to 0\) as \(h\to 0\text{.}\) Hence, by definition of partial derivatives,
\begin{equation*}
\frac{f(g_1(t),g_2(t+h))-f(g_1(t),g_2(t))}{g_2(t+h)-g_2(t)}
\xrightarrow{h\to 0}
\frac{\partial f}{\partial x_2}(\vect g(t))\text{.}
\end{equation*}
To deal with the remaining term we apply the mean value theorem to the function \(x_1\mapsto f(x_1,g_2(t+h))\text{.}\) By assumption, that function is differentiable and its derivative is continuous at \(g_1(t)\text{.}\) Thus, by the mean value theorem there exist \(c_h\in\mathbb R\) such that
\begin{align*}
f(g_1(t+h),g_2(t+h))\amp -f(g_1(t),g_2(t+h))\\
\amp=\bigl(g_1(t+h)-g_1(t)\bigr)\frac{\partial f}{\partial x_1}f(c_h,g_2(t+h))
\end{align*}
with \(\bigl|c_h-g_1(t))\bigr|\leq\bigl|g_1(t+h)-g_1(t))\bigr|\text{.}\) As \(g_1\) is continuous at \(t\) it follows that \(c_h\to g_1(t))\to 0\) as \(h\to 0\text{.}\) Finally, by continuity of \(\partial f/\partial x_1\) with respect to \(x_1\) we conclude that
\begin{equation*}
\frac{f(g_1(t+h),g_2(t+h))-f(g_1(t),g_2(t+h))}{g_1(t+h)-g_1(t)}
\xrightarrow{h\to 0}
\frac{\partial f}{\partial x_1}(\vect g(t))
\end{equation*}
as \(h\to 0\text{.}\) If we put everything together it follows that
\begin{align*}
\lim_{h\to 0}D(h)
\amp=\frac{\partial f}{\partial x_1}(\vect g(t))g_1'(t)
+\frac{\partial f}{\partial x_2}(\vect g(t))g_2'(t)\\
\amp=\grad f(\vect g(t))\cdot\vect g'(t)
\end{align*}
as required. For general \(N\) there are more terms to add and subtract, but the basic ideas stay the same.