Geodesics in a manifold M diffeomorphic to $\mathbb S^2$

I am now reading the book Calculus of Variations written by Jost and I encountered the following problem (in Theorem 2.3.3.):

Let $M$ be a differentiable submanifold of $\mathbb R^d$ diffeomorphic to $\mathbb S^2$. By the compactness and connectedness of $M$, $\forall\ p, q \in M$ with $p \neq q$, there exists a shortest geodesic connecting $p$ and $q$.

Now, what we want to do is to construct a diffeomorphism $$h_0: \mathbb S^2 \rightarrow M$$ with the following properties:

$$p = h_0(0, 0, 1), q = h_0(0, 0, -1)$$ and a shortest geodesic arc $c: [0, 1] \rightarrow M$ with $c(0) = p, c(1) = q$ is given by $$c(t) = h_0(0, \sin \pi t, \cos \pi t).$$

This problem is intuitively true and I have tried "shifting" the inverse image of a geodesic smoothly to a part of a great circle, but I have yet to write down the proof successfully. Thus, I would really like to know if there is anyone who can help me solving this problem or give me some hints. Thanks in advance!

-
In the last equation you, perhaps, want $t$ instead of $x$ in the right hand side. –  Yuri Vyatkin Oct 21 '12 at 8:13
Thanks, I've edited it! –  user43378 Oct 21 '12 at 14:39

Hint. Let $x_0, y_0\in I := [0, 1]$ such that $x_0 < y_0$. Choose a positive real number $\epsilon < x_0$ and a smooth transition function $f$ from the level $0$ to the level $1$ in the interval $I$, that is an increasing smooth function such that $f(x) = 0$ if $x\leq 0$ and $f(x) = 1$ if $x\geq 1$ (see here for a concrete example).
The map defined on $I$ by $$F(x) := \alpha x + k f\left( \frac {x - \epsilon}{x_0 - \epsilon} \right)$$ where $$\alpha := \frac {1 - y_0} {1 - x_0}\\ k := \frac {y_0 - x_0} {1 - x_0}$$ is a strictly increasing smooth function with positive derivative, therefore it is invertible and $F^{-1}$ is smooth. Since $$F(0) = 0\\ F(x_0) = y_0\\ F(1) = 1\\ F^{(n)}(0) = F^{(n)}(1)\quad \forall n\in \mathbb N$$ you can think of $F$ as a (smooth) diffeomorphism of $\mathbb S^1$ onto itself, which sends $x_0$ to $y_0$ and leaves $0\equiv 1$ fixed.