I am trying to solve Exercise $6.5$ in Lee's Introduction to Riemannian manifolds, $2$nd edition. This exercise is about proving that small metric balls are geodesically convex. This should be done as follows.
Let $(M, g)$ be a smooth Riemannian manifold, let $p \in M$ and let $W$ be a uniformly normal neighbhourhood of $p$ (i.e. there is a $\delta > 0$ such that for each point $q \in W, W \subset B_g(q, \delta)$).
(a) Let $\varepsilon > 0$ small enough such that $B_g(p, 3\varepsilon) \subset W$, and define the set $W_\varepsilon \subset TM \times \mathbb{R}$ as $$W_\varepsilon = \{(q,v,t) \in TM \times \mathbb{R} \ \mid \ q \in B_g(p, \varepsilon), v \in T_q(M), |v| = 1, |t|<2\varepsilon \}. $$ Define $$f: W_\varepsilon \to \mathbb{R}, \quad f(q,v,t) = d_g(p, \mathrm{exp}_q(tv))^2. $$ Show that $f$ is smooth.
(b) Show that $\varepsilon$ can be chosen so that $\frac{\partial^2 f}{\partial t^2} > 0$ on $W_\varepsilon$.
(c) For $\varepsilon$ as in (b), let $q_1, q_2 \in B_g(p, \varepsilon)$, and let $\gamma$ be a minimizing geodesic segment from $q_1$ to $q_2$. Show that the map $t \mapsto d_g(p, \gamma(t))$ attains its maximum at the endpoints of the interval on which $\gamma$ is defined.
(d) Conclude that $B_g(p, \varepsilon)$ is geodesically convex.
I think I managed to prove parts (a) and (b). If we define $$u : W_\varepsilon \to \mathbb{R}, u(q, v, t) = \mathrm{exp}_p^{-1} (\mathrm{exp}_q(tv)), $$ then remark that $$f(q,v,t) = |u(q,v,t)|_{\mathrm{Euclidean}}^2, $$ where the right hand side is taken to be the Euclidean norm inside $T_pM$ (which is equal to the $g_p$ norm, as $g_p$ is the Euclidean inner product), and so $f$ is smooth and this proves (a).
Then, we have that $$\frac{\partial f}{\partial t} = 2 \left\langle \frac{\partial u}{\partial t}, u \right\rangle_{\mathrm{Eucliean}} $$ and $$\frac{\partial^2 f}{\partial t^2} = 2 \left\langle \frac{\partial ^2u}{\partial t^2}, u \right\rangle_{\mathrm{Eucliean}} + \left|\frac{\partial u}{\partial t}\right|^2_{\mathrm{Euclidean}}. $$
However, as $$u(p, v, t) = tv, $$ we get that $$ \frac{\partial^2 f}{\partial t^2}(p, v, t) = 2, $$ and so, in a neighbourhood of $(p, v, 0)$ in $TM \times \mathbb{R}, \frac{\partial^2 f}{\partial t^2} > 0$ on said neighbourhood, and we can always shrink $W$ and choose $\varepsilon > 0$ such that this neighbourhood is equal to $W_\varepsilon$, and so this finished (b).
However, I am not sure how to continue with (c) and (d). Also, I do not see the reason for having $B_g(p, 3\varepsilon) \subset W$.
c) A convex function on a closed interval attains the maximum at an endpoint (suppose the interval is $[a,b]$; WLOG $f(a)\geq f(b)$; write arbitrary $x \in [a,b]$ as $x=ta+(1-t)b$; then $f(x)\leq tf(a)+(1-t)f(b) \leq tf(b)+(1-t)f(b)=f(a)$).
d) Geodesic convexity of a set means a distance-minimizing geodesic between two points in the set lies entirely in that set. When the set is a metric ball of radius R around p, that means that distance from p along the geodesic is bounded by R; in particular, if we know that the distances to endpoints are bounded by R and that distance along the geodesic is maximal at one of the endpoints then we are done.