Let $f:\mathbb{R}^{n} \rightarrow \mathbb{R}^{n}$ ($n \geq 2$) be a diffeomorphism which preserves lines (i.e. the image of any line is a line). Prove that $f$ is an affine map.
The idea is to prove that the Jacobian matrix is constant and I can finish from there, but I do not see how to use the condition that $f$ sends lines to lines. Thanks!