Proof 1 (Taylor's theorem with Lagrange remainder)

WLOG we can choose $a=0$, as applying the result for $a=0$ to $g(x) = f(x+a)$ gives the general case.

For $0\leq t\leq h$, let $$ \phi(t) = f(t) - f(0) - tf'(0) - \ldots - \frac{t^{n-1}}{(n-1)!} f^{(n-1)}(0) - \frac{t^n}{n!} B $$ where we choose $B$ such that $\phi(h)=0$.

Note that $\phi$ and its first $(n-1)$ derivatives are continuous on $[0,h]$ and $\phi^{(n)}$ exists on $(0,h)$. Also $\phi^{(k)}(0) = 0$ for $0\leq k\leq n-1$. Now we can repeatedly apply Rolle's theorem: $$\begin{align*} \phi(h) = \phi(0) = 0 &\implies \phi'(\theta_1h) = 0&& \text{for some }\theta_1\in(0,1) \\ \phi'(\theta_1h) = \phi'(0) = 0 &\implies \phi''(\theta_2\theta_1h) = 0&& \text{for some }\theta_2\in(0,1) \\ &\vdots \\ \phi^{(n-1)}(\theta_{n-1}\ldots\theta_2\theta_1h) = \phi^{(n-1)}(0) = 0 &\implies \phi^{(n)}(\theta_n\ldots\theta_2\theta_1h) = 0&& \text{for some }\theta_n\in(0,1). \\ \end{align*}$$

Let $\theta=\theta_1\theta_2\ldots\theta_n\in(0,1)$. Then $$ 0 = \phi^{(n)}(\theta h) = f^{(n)}(\theta h) - B $$ so $B = f^{(n)}(\theta h)$. Rearranging the equation $\phi(h)=0$ yields the result.