Say we have a function $f$ from a differentiable manifold $M$ to $\mathbb{R}$ such that for all points $m \in M$ there exists a neighborhood $U \ni m$ such that $f | U$ is smooth. Can we conclude that $f$ is smooth?
I'm trying to figure this out given the definition of smoothness from Warner's book, namely: "Let $U \subset M$ be open. We say that $f : U \to \mathbb{R}$ is a $C^\infty$ function on U if $f \circ \phi^{-1}$ is $C^\infty$ for each coordinate map $\phi$ on $M$."