Geodesic between two points 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?
 A: Given a surface $S \subset \mathbb{R}^3$ defined by a smooth immersion as indicated, there need not be a smooth geodesic connecting a given pair of points.
For example, let $S$ be the punctured $xy$-plane,
$$S := \{\,(x, y, 0) : (x, y) \neq (0, 0)\,\}. $$
Then, there is no smooth geodesic in $S$ connecting, say, $(-1, 0, 0)$ to $(1, 0, 0)$.
A: 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.   
A: A Riemannian manifold (assume it to be connected) is said to be complete, if it is complete as a metric space with respect to the distance function arising from minimizing the length of curves joining two given points. 
It is said to be geodesically complete, if every geodesic can be extended to all of $\mathbb{R}$ (with a constant speed parametrization). 
A famous theorem (the theorem of Hopf-Rinow) says, that these two definitions coincide. In that case some other interesting properties are known to hold, like: for any two points there is a length minimizing geodesic joining these points. You may want to look it up somewhere.
In general, global questions of this kind are difficult but also very interesting. Key results in that direction are based on the theory of Jacobi fields and resulting comparison theorems. A classic is the book of Cheeger and Ebin. 
You may try to search for 'Global differential geometry'.
For immersions in $\mathbb{R}^n$ another difficulty arises, when the immersion is not an embedding. 
