free homotopy class of closed paths in a compact Riemannian manifold Suppose that $M$ is a compact Riemannian manifold and that $\gamma$ is a closed path in $M$ which is assumed to be continuous but not necessarily piecewise smooth. Must the free homotopy class of $\gamma$ necessarily contain at least one closed geodesic, or can that only be shown on the additional assumption that $\gamma$ is piecewise smooth? Furthermore, how can it be shown that the free homotopy class of $\gamma$ must contain at least one closed geodesic of minimal length, that is, how can we know that the infimum of the lengths of the closed geodesics in the homotopy class is actually attained.
 A: Every continuous path in a Riemannian manifold is homotopic to a piecewise-smooth path. Intuitively, small segments of $\gamma$ can be smoothed by a homotopy (that fixes the endpoints of the segment); since the image of $\gamma$ is compact, we can break the image into finitely many sufficiently small pieces and smooth each piece, obtaining a piecewise-smooth curve.

In detail:
Let $\gamma:[a, b] \to M$ be continuous. For each $t$ in $[a, b]$, let $U(t)$ be the exponential image of a ball centered at $\gamma(t)$ (sufficiently small that the image is contractible in $M$), then use compactness to extract a finite subcovering. For convenience, call these sets "coordinate balls".
Next, inductively construct a sequence of coordinate balls whose first element contains $\gamma(a)$, and such that "each overlaps the next". Precisely, put $u_{1} = a$ and pick a coordinate ball $U_{1}$ containing $\gamma(a)$. Assuming balls $(U_{j})_{j=1}^{m}$ have been chosen and $\gamma(b)$ is not in $U_{m}$, let
$$
u_{m+1} = \inf \{u > u_{m} : \gamma(u) \not\in U_{m}\}
$$
be "the first subsequent time when $\gamma$ leaves $U_{m}$", and pick a coordinate ball $U_{m+1}$ containing $\gamma(u_{m+1})$. This process terminates with a finite covering $(U_{j})_{j=1}^{N}$ since the image of $\gamma$ is covered by finitely many coordinate balls. 
Put $t_{0} = a$ and $t_{N} = b$. For $1 \leq j < N$, choose $t_{j}$ so that $\gamma(t_{j}) \in U_{j} \cap U_{j+1}$. By construction, $\gamma([t_{j-1}, t_{j}]) \subset U_{j}$ for each $j = 1, \dots, N$. Since $U_{j}$ is a coordinate ball, $\gamma|_{[t_{j-1}, t_{j}]}$ is homotopic in $U_{j}$ (with endpoints fixed) to a smooth path. (For example, transfer the path to a Euclidean ball by the exponential map and perform a straight-line homotopy with a line segment.)
Consequently, $\gamma$ itself is homotopic (with endpoints fixed, if it matters) to a piecewise-smooth path.
