Is it true that a Riemannian manifold is flat, if and only if a coordinate transformation $f$ exists, such that the geodesics after transformation is in linear form $\mathbf{y}_t=\mathbf{a}t+\mathbf{y}_0$, where $\mathbf{y}=f(\mathbf{x})$ are the transformed coordinates?

2$\begingroup$ Yes. It is flat if and only if it is locally isometric to an open set in Euclidean space. $\endgroup$ – Peter Michor May 19 '15 at 19:02

1$\begingroup$ This doesn't seem like a researchlevel question. It might have been more appropriate for math.SE. $\endgroup$ – Ben Crowell Jun 22 '15 at 17:34
Yes it is true. One direction is obvious as flat implies around each point there is a neighborhood which is isometric to an open set of standard Euclidean space. In that neighborhood if we use the coordinate given by that isometry, geodesics are of the prescribed form. Conversely if each point has a neighborhood where geodesics are linear w.r.t. some coordinate system then geodesic equation implies $a^i a^j \Gamma_{ij}^k=0$ for any reals $a^i,a^j$. That means $\Gamma_{ij}^k \equiv 0$. So Riemann Curvature Tensor vanishes identically.

$\begingroup$ An example that the OP might wish to think about would be a cylinder with a flat metric. That might help to clarify why the answer is framed in local terms. $\endgroup$ – Ben Crowell May 19 '15 at 23:23