Continuous map of differentiable manifolds is differentiable if differentiable functions pull back to differentiable functions This is Exercise 3.1.A. in Vakil's notes

Suppose that $\pi: X\rightarrow Y$ is a continuous map of differentiable manifolds. Show that $\pi$ is differentiable if differentialble functions pull back to differentiable functions, i.e., if pullback by $\pi$ gives mpa $\mathcal{O}_Y\rightarrow \pi_*\mathcal{O}_X$.

Let $f: V\subseteq Y\rightarrow \mathbb{R}$ be a differentiable function on an open subset of $Y$. Let $(U,\phi)$ be a chart of $X$, $(V,\psi)$ be a chart of $Y$. Then $f\circ\pi(\phi^{-1})$ is differentiable and $f\circ\psi^{-1}$ is differentiable. We need to show that $\psi\circ\pi\circ\phi^{-1}$ is differentiable. I don't know how to prove this. 
Can we say that since $(U,\psi\circ\pi)$ constructs a chart of $X$, by the compatibility, $\psi\circ\pi\circ\phi^{-1}$ is differentiable? This seems true but this does not use the fact that $f$ is differentiable.
Sorry I have no background of Differentiable Manifolds. Any help would be appreciated.
I also saw this post: pullback of continuous maps of manifolds, but I don't understand how $\gamma$ is smooth in the answer. $\gamma=\beta\circ\rho$, where $\rho$ is defined to be smooth, but $\beta$ is not. 
 A: Let $\pi:X\to Y$ be a continuous map of differentiable manifolds such that
\begin{equation*}
\forall V\subseteq Y\,\text{open,}\,\pi_{*}(V):f\in\mathcal{O}_Y(V)\mapsto f\circ\pi_{|\pi^{-1}(V)}\in\mathcal{O}_X(\pi^{-1}(V));
\end{equation*}
if $(V,\psi)$ is a chart of $Y$, without loss of generality one can assume that $(\pi^{-1}(V)=U,\phi)$ is a chart of $X$.
By definition $U$ is homeomorphic to $\mathbb{R}^n$ and $V$ is homeomorphic to $\mathbb{R}^m$, then $\psi\circ\pi_{|U}\circ\phi^{-1}:\mathbb{R}^n\to\mathbb{R}^m$ is a continuous map; by hypothesis
\begin{equation*}
\forall f\in\mathcal{O}_Y(V),\,f\circ\pi_{|U}=(f\circ\psi^{-1})\circ(\psi\circ\pi_{|U}):U\to V\to\mathbb{R}
\end{equation*}
is differentiable, that is
\begin{equation*}
f\circ\pi_{|U}\circ\phi^{-1}=(f\circ\psi^{-1})\circ(\psi\circ\pi_{|U}\circ\phi^{-1}):\mathbb{R}^n\to U\to\mathbb{R}
\end{equation*}
is differentiable.
Passing to coordinates, for any $f\in\mathcal{O}_X(V)$ is
\begin{equation*}
f\circ\psi^{-1}:\underline{y}=(y_1,\dots,y_m)\in\mathbb{R}^m\to f\left(\psi^{-1}\left(\underline{y}\right)\right)\in\mathbb{R},
\end{equation*}
in other words, $f\circ\psi^{-1}$ is a differentiable function in $m$ variables. Of course, the $y_i$'s are the (local) coordinates of $Y$ on $V$; one kows that the functions
\begin{equation*}
\psi_i\equiv pr_i\circ\psi^{-1}:(y_1,\dots,y_m)\in\mathbb{R}^m\to y_i\in\mathbb{R}
\end{equation*}
are differentiable.
The same reasoning holds for $\phi$!
By previous remark, one proves that the component functions of $\pi_{|U}$ are differentiable; by gluing axiom, $\pi$ is a differentiable map of manifolds.
