TITLE: Geodesic between two points
QUESTION [11 upvotes]: I have a question about geodesics.
So far I know that for any surface $S$ defined by some immersion $f: U \subset\mathbb{R}^2 \rightarrow S \subset \mathbb{R}^3,$ we have that for any point on the surface and any direction, there exists locally a geodesic ( due to Picard-Lindelöf applied to the geodesic equation). 
But what can we say globally? To me it would be more natural to ask that if our surface is path-connected, does this imply that there exists a geodesic between any two points? What about more general manifolds, is this then true? Is there a similar existence theorem for the geodesic ODE in the context of this boundary value problem?

REPLY [3 votes]: if your set/manifold is compact then it means it is geodesically complete(Hopf-Rinow theorem). Thus you can extend your curve to R. For example, SO(n) is geodesically complete. If we are talking about a unique distance minimizing curve then every point on the manifold has a certain local domain where the uniqueness condition holds. For further detail, look at the cut-locus concept.