I'm looking for an example of a non-Euclidean Riemannian manifold $(M,g)$ such that we could define a non-constant affine function $f:M\rightarrow \mathbb{R}$?