You can approximate the curve with a polygonal path (I will define what I mean by "polygonal path" here); by choosing $n$ points $\{ y_k \}_{k=1}^{n}$ on the curve, including its initial and terminal points, approximate it by the polygonal path made of the line segments with endpoints $y_k$ and $y_{k+1}$, $k=1,...,n-1$. As $n\to\infty$, the approximation is better and better. This is because $\gamma$ is $C^1$.
Then we only need to prove that of all the polygonal paths from $x$ to $y$, the shortest one is the one made of only a single line segment, the line segment from $x$ to $y$
Can you take it from there, using the Triangle Inequality and some induction?