Can I prescribe the geodesics? Consider $J$ an open interval of $\mathbb{R}$. 
An inner product on $\mathbb{R}$ is necessarily of the form $(u,v) \in \mathbb{R}^{2} \, \mapsto \, auv$ with $a > 0$. Therefore, a Riemannian metric on $J$ is necessarily of the form 
$$ p \in J \, \mapsto \, g_{p} $$
where :
$$ \forall p \in J, \forall (u,v) \in T_{p}J \simeq \mathbb{R}, \, g_{p}(u,v) = f(p) uv $$
with $f$ a smooth, positive function on $J$. 
The geodesic equation for this Riemannian metric becomes :
$$ \ddot{\gamma}(t) + \frac{1}{2}\frac{f'\big( \gamma(t) \big)}{f\big( \gamma(t) \big)}\big( \dot{\gamma}(t) \big)^{2} = 0. \tag{$\star$} $$
If, for example, $J=\mathbb{R}$ and $f \equiv 1$, we obtain straight lines as geodesics. My question is the following : can we prescribe a metric on $J$ for which geodesics would not be monotonic (such as the sine or cosine function) ? I cannot find a simple argument to prove (or disprove) it. I am under the impression that, for any choice of $f$, the solutions of $(\star)$ will always be monotonic. There must be missing something here.
 A: Geodesics have constant speed as measured by the metric. (In fact in one dimension this is necessary and sufficient - since there's no other dimension to "curve in to", the only requirement the geodesic equation can impose is the speed.)
You can verify that fact in this case by differentiating $g(\dot \gamma,\dot \gamma) = f \dot \gamma^2$ in time to get $2f \dot \gamma \ddot \gamma + f'\dot \gamma^3$ - divide through by $2f\dot \gamma$ and you have the LHS of your geodesic equation. Thus if $\dot \gamma^2$ is nonzero anywhere it must be nonzero everywhere, so $\dot \gamma$ cannot pass through zero; i.e. either $\dot \gamma >0$ everywhere or $\dot \gamma <0$ everywhere. This means $\gamma$ is monotonic.
A: A non-monotonic path can always be shortened. To be precise, given $a < b \in J$, and given a piecewise smooth path $\gamma : [0,1] \to J$ such that $\gamma(0)=a$ and $\gamma(1)=b$, if $\gamma$ is not monotonic then it is not one-to-one and so you can always find a shorter path. Since $\gamma$ is not monotonic, one can find $0 \le r < s \le 1$ such that $\gamma(r) = \gamma(s)$ and so that $\gamma$ is not constant on the subinterval $[r,s]$. Then define $\gamma' :[0,1] \to J$ by the formula
$$\gamma'(t) = \begin{cases}
\gamma(t) & \text{if $t \not\in [r,s]$} \\
\gamma(r)=\gamma(s) &\text{if $t \in [r,s]$}
\end{cases}
$$
A short calculation shows that the path length integral of $\gamma'$ is equal to the path length integral of $\gamma$ minus the path length integral of the restricted path $\gamma | [r,s]$; the latter is positive because $\gamma$ is non constant on $[r,s]$.
A: Not possible because if you set up geodesic curvature $\kappa_g$ it changes sign for oscillatory non-monotonic behavior of tangent rotation. It should be strictly zero for a geodesic.
EDIT1:
i.e., we cannot further bend a geodesic but can rotate it about a normal making a bundle in tangent plane.
