[guided]` block, since it is the main analytic input.)
Apply (MC) with $V = W = \dot\gamma$ (which is a smooth lift of $\gamma$ to $TM$ by smoothness of $\gamma$):
\begin{align*}
f'(t) &= \frac{d}{dt} g_{\gamma(t)}\bigl(\dot\gamma(t), \dot\gamma(t)\bigr) = 2\, g_{\gamma(t)}\!\left(\frac{\nabla \dot\gamma}{dt}(t),\, \dot\gamma(t)\right).
\end{align*}
We used the symmetry $g(V, W) = g(W, V)$ to combine the two terms on the right of (MC) into a factor of $2$.
[guided]
The metric-compatibility identity (MC) is the form of $\nabla g = 0$ adapted to sections along curves. Let us verify it from scratch.
Fix $t_0 \in I$ and choose a chart-and-frame neighbourhood as in the proof of the [Covariant Derivative Along a Curve](/theorems/2708). Write $V(t) = \sum_i V_i(t) e_i(\gamma(t))$ and $W(t) = \sum_i W_i(t) e_i(\gamma(t))$ in a local orthonormal frame for $TM$ — alternatively, use a coordinate frame and the metric components $g_{ij}$. We use a coordinate frame $\{\partial_{x_k}\}$ for clarity.
Then $g_{\gamma(t)}(V(t), W(t)) = \sum_{i,j} g_{ij}(\gamma(t)) V_i(t) W_j(t)$. Differentiating in $t$ with the product and chain rules,
\begin{align*}
\frac{d}{dt}\bigl(g_{ij}(\gamma(t)) V_i(t) W_j(t)\bigr) = \sum_k \dot x_k(t) (\partial_{x_k} g_{ij})(\gamma(t)) V_i W_j + g_{ij}(\gamma(t)) \dot V_i W_j + g_{ij}(\gamma(t)) V_i \dot W_j.
\end{align*}
Now invoke metric compatibility on $M$: $\partial_{x_k} g_{ij} = g(\nabla_{\partial_{x_k}} \partial_{x_i}, \partial_{x_j}) + g(\partial_{x_i}, \nabla_{\partial_{x_k}} \partial_{x_j}) = \sum_\ell \Gamma_{ik}^\ell g_{\ell j} + \sum_\ell \Gamma_{jk}^\ell g_{i\ell}$. Substituting and rearranging, the three terms regroup into $g(\frac{\nabla V}{dt}, W) + g(V, \frac{\nabla W}{dt})$ using the local formula $(\frac{\nabla V}{dt})_i = \dot V_i + \sum_{j,k} \Gamma_{jk}^i V_j \dot x_k$ from the previous theorem. The mechanical computation is straightforward; the structural reason the identity holds is that $\nabla g = 0$ holds on $M$ and the covariant derivative along $\gamma$ is constructed to preserve all algebraic identities of $\nabla$ that involve only directional differentiation along $\dot\gamma$.
Why apply (MC) to $V = W = \dot\gamma$? Because $\dot\gamma$ is itself a smooth lift of $\gamma$ to $TM$, and the squared-speed function $f$ is exactly $g(\dot\gamma, \dot\gamma)$ — so (MC) gives $f'$ in terms of $\frac{\nabla \dot\gamma}{dt}$, which is what the geodesic equation controls. Note that $\dot\gamma$ is **not** in general the restriction to $\gamma$ of any vector field on $M$ — it is intrinsically a section of $\gamma^* TM$, which is why the covariant derivative *along the curve* is the right object here, not $\nabla_X Y$ for vector fields $X, Y$ on $M$.[/guided]