I already know that one can extend a smooth function defined on a closed subset of a smooth manifold to the whole manifold using smooth bump function (John Lee : Smooth Manifold). So i wonder if we can make such a extension to a smooth map defined on a open subset $f : U\subset M \rightarrow \mathbb{R}$. I did some scratch and here is what i found :
Let $f : U\subset M \rightarrow \mathbb{R}$ be a smooth map defined on an open subset $U$ of a smooth manifold $M$. Let $(U,\psi)$ be a chart for $U$. Choose a sufficiently small closed ball $B$ contained in $\psi(U)$, and then because $\psi$ is continous then $A=\psi^{-1}(B)\subset U$ is a closed subset in $M$. By Prop.2.25 (John Lee: Smooth Manifold), we have a smooth bump function $\varphi : M \rightarrow \mathbb{R}$ s.t $\varphi \equiv 1$ on $A$ and $supp$ $\varphi \subset U$. Because $\varphi$ is smooth on $M$, then $\varphi|_U$ is smooth on $U$. Hence $\varphi|_U f : U \rightarrow \mathbb{R}$ is smooth on $U$ and $supp$ $(\varphi|_U f) \subset U$. Choose an open cover for $M$ by $\{U\} \cup \{M \smallsetminus supp(\varphi|_U f)\}$ and define a zero function $g : M \smallsetminus supp(\varphi|_U f) \rightarrow \mathbb{R}$. Because $f$ and $g$ agree on the overlap then by Gluing Lemma, we have an extension for $\varphi|_U f$. Which is equal to extension of the restriction of $f$ on some nbhd contained in $A$.
Is this correct ? For my purpose, this is enough. But does anyone know how to make such an extension for $f$ on $U$ (not for the restriction of $f$ like i did) ? Thank you.
You cannot extend a smooth function defined on an open set. Heuristically, the behaviour of $f$ on the open set's boundary can be arbitrarily wild. For example $M = \mathbb{R}, U = (-\pi/2, \pi/2), f(x) = \tan(x)$.
For a bounded example, take $M = \mathbb{R}, U = (-1, 1), f(x) = \arcsin(x)$