Let $M$ be a differentiable manifold, $U\subseteq M$ an open neighborhood of $p\in M$ and $f:U\to\mathbb{R}$ differentiable. Then there exists $F:M\to\mathbb{R}$ differentiable such that $F=f$ in a neighborhood of $p$.
I found this problem in a book, and it's solved in the case $M=\mathbb{R}^n$, but it says the general case is easy by using charts, but I don't understand it yet.
This is what I have tried. Suppose $\dim M=n$ and take a chart $(V,\phi)$ with $p\in V$. Then $$f\circ\phi^{-1}:\phi (U\cap V)\to \mathbb{R}$$
is differentiable, where $\phi(U\cap V)$ is a neighborhood of $\phi(p)$ in $\mathbb{R}^n$.
In $\mathbb{R}^n$, we can now find $F:\mathbb{R}^n\to\mathbb{R}$ such that $F=f\circ\phi^{-1}$ in some neighborhood of $\phi (p)$, say $V_0\subseteq\phi(U\cap V)$.
From here I can't see how to obtain a differentiable function $M\to\mathbb{R}$. First I thougt something like $F\circ\phi$, but it's not defined in the whole manifold $M$.
Any hint? Thank you.