Let $M$, $N$ be two smooth manifolds (Hausdorff and second-countable). Suppose $K \subset U \subset M$, where $K$ is compact and $U$ is open in $M$. If $f: U \rightarrow N$ is a smooth map, is there a smooth map $\tilde{f}:M \rightarrow N$ such that $\tilde{f} = f$ on a neighbourhood of $K$?
I know that it is true when $K$ is a single point or $N = \mathbb{R}^n$. But in general, I don't know if it can be figured out by partition of unity. (I assume that $M$ and $N$ have no boundaries. But I guess the case with boundary is similar.)
Let $M= \Bbb C$, $U = \{z \in \Bbb C \mid \frac{1}{2}<|z|<2\}$, $K = N = S^1$, and $f \colon U \to N$ defined by $f(z) = \frac{z}{|z|}$. Then $f$ is smooth. However, $f$ does not even admit a continuous extension to $\Bbb C$: otherwise, it would induce a retraction of $D = \{z \in \Bbb C \mid |z| \leq 1\}$ to $\partial D = S^1$, which is known to be impossible.