I was reading a bit in "Introduction to Smooth Manifolds" by John M. Lee for some motivations and came across the following section on page $11$-$12$. "Each point in $M$ is in the domain of a coordinate map $\varphi:U \to \hat{U}.$ A plausible definition of a smooth function on $M$ would be to say that $f:M \to \mathbb{R}$ is smooth if and only if the composition $f \circ \varphi^{-1}:\hat{U} \to \mathbb{R}$ is smooth in the sense of ordinary calculus. But this will only make sense if this property is independent of the choice of coordinate chart."
Why is that the case? Wouldn't the definition "$f$ is continuous iff at every point $p$ there is some chart $(U,\varphi)$ with $p \in U$ such that $f \circ \varphi^{-1}$ is smooth" be a perfectly fine definition? Maybe I am overlooking something basic here, but I, at the moment, don't see why this wouldn't be well defined.