Picture below is from the 196th page of do Carmo's Riemannian Geometry. I don't know why red line is right.
On each $(t_i,t_{i+1})$, there is $\frac{D}{dt}\frac{dc}{dt}=0$. And since $c(t)$ is $C^1$, I know that $\frac{dc}{dt}$ is continuous on $[0,a]$. But seemly, they are not enough to get $\frac{D}{dt}\frac{dc}{dt}(t_i)=0$, since $\frac{D}{dt}\frac{dc}{dt}$ is similiar to the second derivative. $C^1$ don't imply that $\frac{D}{dt}\frac{dc}{dt}$ is continuous.
How to understand it?
PS(2023-12-26): Thinking of two geodesics connected end to end as agreeing on the tangent vector at the point where they are connected. So they are actually a geodesic. Therefore, $\frac{D}{dt}\frac{dc}{dt}(t_i)=0$ which is needless now.

If I understand correctly, your doubt is about one of the last steps in the proof that, given a piecewise differentiable curve $c\colon[0,a]\to M$ on a Riemannian manifold $(M,g)$, if $$\frac{\mathrm{d}E}{\mathrm{d}s}(0)=0,\ \text{for any proper variation}\ f\ \text{of}\ c,\tag{$\ast$}$$ then $c$ is a geodesic of $(M,g)$.
As you also point out, as the first consequence of ($\ast$), the author obtains that, for each subinterval $[t_{i-1},t_i]$ where $c(t)$ is differentiable, $c(t)$ is a geodesic, i.e. $$\frac{D}{\mathrm{dt}}\frac{\mathrm{d}c}{\mathrm{d}t}=0,\ \text{for}\ t\in[t_{i-1},t_i].\tag{1}$$
As the second consequence of ($\ast$), the author obtains that $c(t)$ is actually of class $C^1$ on $[0,a]$, i.e. $$\lim_{t\to t_i^-}\frac{\mathrm{d}c}{\mathrm{d}t}(t)=\lim_{t\to t_i^+}\frac{\mathrm{d}c}{\mathrm{d}t}(t),\ \text{for all}\ i=1,\ldots N,\tag{2}$$ where $(t_0,\ldots,t_{N+1})$ is the partition of $[0,a]$, with $t_0=0$ and $t_{N+1}=a$, such that $c(t)$ is differentiable on $[t_{i-1},t_i]$ for each $i=1,\ldots,N+1$.
Let us recall now that, in local coordinates $x_1,\ldots,x_n$, the geodesic equation ($1$) becomes the second order ODE $$\frac{\mathrm{d}^2x_k}{\mathrm{d}t^2}+\sum_{i,j}\Gamma_{ij}^k\frac{\mathrm{d}x_i}{\mathrm{d}t}\frac{\mathrm{d}x_j}{\mathrm{d}t}=0,\ \text{with}\ k=1,\ldots,n.$$ Solving the latter for the second order derivatives, taking the limits as $t$ goes to $t_i$, and keeping in account (2), one obtains that $$\lim_{t\to t_i^-}\frac{\mathrm{d}^2x_k}{\mathrm{d}t^2}(t)=\lim_{t\to t_i^+}\frac{\mathrm{d}^2x_k}{\mathrm{d}t^2}(t),\ \text{for all}\ k=1,\ldots,n,\\ \text{and}\ i=1,\ldots N.$$ This shows that $c(t)$ is actually of class $C^2$ on $[0,a]$ and satisfies the geodesic equation on the entire interval $[0,a]$, i.e. $$\frac{D}{\mathrm{dt}}\frac{\mathrm{d}c}{\mathrm{d}t}=0,\ \text{for}\ t\in[0,a].\tag{1.bis}$$