Let $M$ and $N$ be two differentiable manifolds and $f:M\to N$ continuous. Show that $f$ is differentiable if and only if $g\circ f\in C^\infty(M)$ for all $g\in C^\infty(N)$.
My attempt:
For the direction "$\Leftarrow$" I guess that one could use some kind of identity map, however $g$ maps to $\mathbb{R}$.
For the other direction what I basically have to show is that for every chart $(\psi,V)$ in $M$ one has that $(g\circ f\circ \psi^{-1})^{(k)}$ exists for every $k\in\mathbb{N}$ (don't I?). What I tried is taking a chart $(\phi, U)$ in $N$ and considering $(g\circ\phi^{-1}\circ\phi\circ f\circ\psi^{-1})^{(k)}_x$. I can calculate the first derivative $d(g\circ\phi^{-1}\circ\phi\circ f\circ\psi^{-1})_x=d(g\circ\phi^{-1})_{\phi\circ f\circ\psi^{-1}(x)}\circ d(\phi\circ f\circ\psi^{-1})_x$. I don't really know how to continue since by assumption only the first derivative of $f$ exists. Does someone have a hint?