# The extension of function

$M$ is a smooth manifold and $A$ is a subset of $M$. If a function $f$ on $M$ is $C^\infty$ on $A$(that is, for every point $x\in A$, there is a open set $V_x$ and a $C^\infty$ function $f_x$ such that $f_x=f$ on $A \cap {V_x}$), then is there a $C^\infty$ function $f_1$ on $M$ such that $f_1=f$ on $A$?

-
Think about $f(x) = 1/x$ on $M = (-1, 1) \backslash \{0\}$. – student May 1 '12 at 14:53
If $A$ is closed, this is Whitney's extension theorem, original paper – t.b. May 1 '12 at 15:07

Choose a $\mathbb{C}^{\infty}$ bump function $\rho$ which is supported in $A\cap V_x$ and identically $1$ in a nbd $V$ of $x$, Define $$f_1(x)=\{\rho(x)f(x) \text{for } x\in A\cap V_x$$ and $$0 \text{for x not in } A\cap V_x$$ As the product of two $\mathbb{C}^{\infty}$ function on $A\cap V_x$, $f_1$ is $\mathbb{C}^{\infty}$ on $A\cap V_x$. If $x$ is not in $A\cap V_x$, then $x$ is not in $supp\rho$, and so there is an open set containing $x$ on which $f_1$ is $0$ since $supp\rho$ is closed. So $f_1$ is also $\mathbb{C}^{\infty}$ at every point not in $A\cap V_x$ Finally since $\rho\equiv 1$ on $V$ the function $f_1$ agrees with $f$ on $V$
Your "proof" implicitly uses the assumption that there is an open neighborhood $V$ of $x$ contained in $A\cap V_x$. This is in general not true (let $M = \mathbb{R}$ and $A = \{0\}$; any bump function supported in $A\cap V_x$ must vanish identically). Furthermore, notice that if $A$ is actually open, Leandro gave a counterexample in the comments. – Willie Wong Jun 4 '12 at 13:51