I want to prove the following:
A continuous function $f:M\to N$ is smooth if and only if $g\circ f:f^{-1}(V)\to\Bbb R$ are smooth for all $g\in C^\infty(N)$, where $V\subset N$ is open.
In our class, we defined differentiability as follows:
A continuous function $f:M\to N$ is smooth (or infinitely differentiable $\mathcal C^\infty$) in $p\in M$ if there exist charts $(U,\varphi)$ of $M$ (with $x_0\in U$) and $(V,\psi)$ of $N$ with $f(U)\subset V$ such that $\psi\circ f\circ \varphi^{-1}$ is differentiable $(\mathcal C^\infty)$ in $\varphi(x_0)$. $f$ is differentiable if it is in all $p\in M$.
I did the following, not sure if it is correct or not:
$(\Leftarrow)$ Suppose that $g\circ f$ are differentiable for all $g\in C^\infty(N)$. We can define the chart of $N$ $(V,g)$ for each $g$, and define a chart $(U,\varphi)$ from $M$. Since $\varphi$ is a homeomorphism, it is differentiable, so we can compose it to our preceding function and get that $g\circ f\circ \varphi^{-1}$ is differentiable. From the definition, $f$ is differentiable.
$(\Rightarrow)$ Suppose now that $f$ is differentiable. Then, by definition, take charts $(U,\varphi)$ from $M$ and $(V,\psi)$ from $N$ such that $\psi\circ f\circ\varphi^{-1}$ is differentiable. Now we see that $\varphi$ is invertible, since it is a homeomorphism. So $\varphi^{-1}$ exists and it is differentiable. Hence, $(\psi\circ f \circ \varphi^{-1})\circ\varphi = \psi\circ f$ is differentiable. Rename $\psi = g$, and we are done.
Is this correct? If not, how can I improve it?