# component of a differentiable function differentiable?

in differential geometry we define a function $f:M \rightarrow N$ between differential manifolds to be differentiable, if the function $y \circ f \circ x^{-1}$ (where $y$ and $x$ are appropriate coordinate charts) is differentiable. I was wondering now:

Let's say $f$ is a function $f:\mathbb{R}^n \rightarrow \mathbb{R}^m$ and let $g,h$ be diffeomorphisms $g: \mathbb{R}^m \rightarrow \mathbb{R}^m$ and $h:\mathbb{R}^n \rightarrow \mathbb{R}^n$. If we know now that the composition $g \circ f \circ h$ is differentiable. Can we conclude then, that $f$ itself is a differentiable function?

Intuitively i would think that this is true but I don't see how I could proof that right now.

-
If $\phi = g \circ f \circ h$ is differentiable, then since $f = g^{-1} \circ \phi \circ h^{-1}$, $f$ must be differentiable. ($g,h$ are diffeomorphisms.)