In the paper,
Cheeger, Jeff; Gromoll, Detlef, On the structure of complete manifolds of nonnegative curvature, Ann. Math. (2) 96, 413-443 (1972). ZBL0246.53049, it has been proved that any complete manifolds $M$ of non-negative curvature can be covered with compact, totally convex and totally geodesic submanifolds $\{C_t\}$ such that for $t_2\geq t_1$ implies $C_{t_1}\subset C_{t_2}$.
Let $f:M\rightarrow\mathbb{R}$ be a continuous convex function then $f$ is constant on each $\{C_t\}$ and hence $f$ is constant on $M$.
But I know this is not true since there are continuous convex function on $\mathbb{R}^2$. I can not find where I am doing wrong. Please help me. Thank you
To close this question: It stems from the confusion between two notions: Of a manifold and a manifold with boundary. The subsets $C_t$ in Cheeger-Gromoll are submanifolds with boundary (except maybe for one of them, the "soul" of $M$). On the other hand, Yau's theorem (which in the case of compact manifolds is just the trivial observation that a convex nonconstant function on a connected Riemannian manifold cannot attain local maxima) is about manifolds without boundary. Hence, it does not apply to $C_t$. Of course, $\partial C_t$ has no boundary but then restriction a convex function to $\partial C_t$ is no longer convex (in general).