Function $f: M \to \mathbb{R}$ is smooth iff $f\circ\phi^{-1}$ is smooth for every chart $\phi$ I am trying to solve exercise 6.5 of Loring Tu's book "An Introduction to Manifolds" which states that a function $f: M \to \mathbb{R}$ on a smooth manifold $M$ is smooth if, and only if for every chart $(U,\phi)$ on $M$,  $f\circ \phi^{-1}$ is smooth on $\phi(U)$. As far as I understand, I have to consider $\phi(U)$, which is an open set of $\mathbb{R}^{n}$ for some $n \ge 1$, as a manifold itself (a submanifold).
My attempt is as follows.
Suppose $f$ is smooth and $\phi$ a chart on $M$. Take $1_{\phi(U)}: \phi(U) \to \phi(U)$ to be the identity map $1_{\phi(U)}(x) = x$. It is a chart on $\phi(U)$ because it is compatible with the identity map $\operatorname{Id}: \mathbb{R}^{n}\to \mathbb{R}^{n}$, so it is contained in the differentiable structure of $\mathbb{R}^{n}$. Moreover $f\circ \phi^{-1}\circ 1_{\phi(U)}$ is smooth because $f\circ \phi^{-1}$ is smooth map by hypothesis. Hence, $f\circ \phi^{-1}$ is smooth on $\phi(U)$.
Conversely, suppose if $f\circ \phi^{-1}$ is smooth for every chart $(U,\phi)$ on $M$, then $f = (f\circ \phi^{-1}\circ \phi)$ is smooth on $U$ because it is the composite of smooth functions.
Is my solution correct?
 A: I see from your arguments that you're trying to make use of the definition of a smooth map between manifolds, but that's not really necessary. As I pointed out in my commment, the point of the exercise is simply to show that the choice of chart in the definition of smooth function doesn't matter.
Indeed, suppose $f: M \to \Bbb R$ is smooth at $x$. By definition, this means the existence of a chart $(U, \phi)$ around $x$ such that $f \circ \phi^{^1}: \phi(U) \to R$ is smooth (i.e., $C^\infty$) at $\phi(x)$.
Now, given any other chart $(V, \psi)$ around $x$, the point $\psi(x)$ lies in the open set $\psi(U\cap V) \subset \Bbb R$, and in this open we can write the function $f \circ \psi$ as a composition
$$ f \circ \psi^{-1} = (f \circ \phi^{-1}) \circ (\phi \circ \psi^{-1}): \psi (U \cap V) \to \Bbb R.$$
Now $f \circ \phi^{^1}$ is smooth at $\phi(x)$ by the definition of smoothness for the function $f$, while $\phi \circ \psi^{-1}$ is smooth at $\psi(x)$ because transition maps are smooth by definition.
Hence $f \circ \psi^{-1}$ is smooth at $\psi(x)$, and we see that $f$ satisfy the smoothness condition in any chart around $x$.
