Does the geodesic on a surface $z = f(x,y)$ always trace out a straight line in the $xy$ plane? Let $z = f(x,y)$ be a surface. Let $(x_0, y_0, z_0)$ and $(x_1, y_1, z_1)$ be two points on that surface. Let $g(t) = \langle x(t), y(t), z(t)\rangle$ be a parameterization of the geodesic curve between the two points.  Is the following statement true?
Let $g_{xy} = \langle x(t), y(t), 0\rangle$ be the projection of the geodesic onto the $xy$ plane. Then $g_{xy}$ is the straight line defined by the points $(x_0, y_0)$ and $(x_1, y_1)$ on the $xy$ plane.
 A: You've got good answers, but here's a "computation-free" reason.
If it were true that

"The projection of a geodesic of a graph $z = f(x, y)$ to the $(x, y)$-plane is a line segment"

then by rotating spatial coordinates in such a way that the surface is still locally represented by a graph $z = \phi(x, y)$, the projection to a generic plane would be a line, from which it follows that the geodesic itself is a segment.
Since most geodesics on a non-planar surface are not line segments, the conjecture cannot be correct.
A: Let $\gamma(t)=(x(t),y(t),f(x(t),y(t)))$ be a geodesic on the surface $z=f(x,y)$ parameterized to have constant speed. It must have that its acceleration is always normal to the surface. In particular,
$\gamma'(t)$ is always parallel to $(f_x(x(t),y(t)),f_y(x(t),y(t)),-1)$, which is a normal. However, note that this implies that, unless $f_x$ and $f_y$ are zero or the geodesic on the surface is a straight line in $\mathbb R^3$, there is acceleration in its projection to the plane. Of course, things could conspire to make the projection straight - the lateral acceleration could always be parallel to the projection of the velocity - but, it's actually very rare that the geodesic on such a surface projects to a straight line.
A: If the rigid surface containing the geodesic curve  rolls  in the plane of osculation with common normal without slipping then we have the same zero geodesic curvature in the plane as well as the surface, the trace on the plane is a straight line.
The instantaneous projection without any rolling is not in general a straight line.
The rolling contact line and projection of given line in fixed $(x-,y-) $ plane are two distinctly different lines.
