Let $X$, $Y$ be manifolds, with respective coordinate charts $\{(U_{\alpha}, \varphi_{\alpha})\}_{\alpha\in I}$ and $\{(V_{\beta}, \psi_{\beta})\}_{\beta\in J}$.
I want to show that $f:X\to Y$ is differentiable if and only if for every $C^{\infty}$ map $g:Y\to\mathbb{R}^{n}$, $g\circ f:X\to \mathbb{R}^{n}$ is $C^{\infty}$.
The $(\Rightarrow)$ direction I had no problem with.
For the $(\Leftarrow)$ direction, a hint in the text suggests using a bump function. But I am stuck as to where the bump function will be helpful.
If I suppose that for every $\alpha\in I$, $g\circ f\circ \varphi_{\alpha}$ is $C^{\infty}$ for all $C^{\infty}$ functions $g:Y\to\mathbb{R}^{n}$, then I can observe that for any $\beta\in J$, there is agreement between $g\circ f\circ \varphi_{\alpha}$ and $g\circ \psi_{\beta}\circ \psi_{\beta}^{-1}\circ f\circ \varphi_{\alpha}$ on the domain of the latter map.
I know that $g\circ f\circ \varphi_{\alpha}$ and $g\circ \psi_{\beta}$ are $C^{\infty}$, but this does not directly imply that $\psi_{\beta}^{-1}\circ f\circ \varphi_{\alpha}$ is $C^{\infty}$ which is what is desired.
Can anyone offer advice on how I can use a smooth bump function to fix this proof?