Let $X$ be a nonempty subset of $\mathbb{R}^n$ and $f:X \rightarrow \mathbb{R}^m$. In differential topology (see e.g. Milnor, Topology from the Differentiable Viewpoint or Guillemin and Pollack, Differential Topology), we call $f$ smooth if for any $x \in X$ there is an open neighborhood $U$ of $x$ in $\mathbb{R}^n$ and a smooth (in the usual sense, that is with continuous partial derivatives of all orders) map $F:U \rightarrow \mathbb{R}^m$ such that $F$ and $f$ coincide on $U \cap X$. This definition has clearly a local nature and it is for sure the right definition to give in differential topology. My curiosity is its relation with its global counterpart. Call $f:X \rightarrow \mathbb{R}^m$ globally smooth if there is an open subset of $\mathbb{R}^n$ containing $X$ and a smooth function $F:U \rightarrow \mathbb{R}^m$ such that $F|_X = f$.
The two definitions are very different in nature, but are they actually different? In other terms, is there some example of a smooth function which is not globally smooth?
Thank you very much for your attention.
NOTE. The fact that the definition of smooth function has a local nature is clear. We can make it even more clear by stating the following simple
Proposition. Let $X$ be a nonempty subset of $\mathbb{R}^n$ and $f:X \rightarrow \mathbb{R}^m$. $f$ is smooth if and only if for any $x \in X$ there is a neighborhood $N$ of $x$ in $X$ such that $f|_N$ is smooth.
Proof. If $f$ is smooth, then for any nonempty subset $S$ of $X$, $f|_S$ is smooth. Conversely, assume that for any $x \in X$ there is a neighborhood $N$ of $x$ in $X$ such that $f|_N$ is smooth. Let $x \in X$ and let $N$ be such a neighborhood. Then there exists an open neighborhood $U$ of $x$ in $\mathbb{R}^n$ and a smooth function $F:U \rightarrow \mathbb{R}^m$ such that $F$ and $f$ coincide on $U \cap N$. If $V$ is an open neighborhood of $x$ in $X$ such that $V \subset N$, there is an open subset $W$ of $\mathbb{R}^n$ such that $V= W \cap X$. But then $U \cap W$ is an open neighborhood of $x$ in $\mathbb{R}^n$, $F|_{U \cap W}$ is a smooth map, and $F|_{U \cap W}$ and $f$ coincide on $ U \cap W \cap X = U \cap V \subset U \cap N$.