Exercise 1.74 of the book Manifolds and differential geometry of Jeffrey M. Lee says:
Show that if a function is smooth on an arbitrary set $S\subseteq M$ as defined earlier, then it has a smooth extension to an open set that contains $S$.
Here Lee refers to Definition 1.58:
Let $S$ be an arbitrary subset of a smooth manifold $M$. Let $f:S\to N$ be a continuous map where $N$ is a smooth manifold. The map $f$ is said to be $C^r$ if for every $s\in S$ there is an open set $O\subseteq M$ containing $s$ and a map $\tilde f$ that is $C^r$ on $O$ and such that $\tilde f|S\cap O=f$.
First I want to comment two things about definition 1.58. First I think it should be $\tilde f|S\cap O=f|S\cap O$ instead. Second: why do we require $f$ continuous? Isn't that implied?
Definition 1.58 refers to general maps $f:S\to N$ but I can only prove it for $N=R^n$ as follows:
Assume $f:S\to R^n$ is smooth and for each $s\in S$ let $U_s$ be a nbd of $s$ and $f_s:U_s\to R^n$ be a smooth map such that $f_s|U_s\cap S=f|U_s\cap S$. Let $\{\phi_s\}_{s\in S}$ be a partition of unity dominated by $\{U_s\}_{s\in S}$. For each $x\in X$ we define $A_x=\{s\in S: x\in \text{supp }\phi_s\}$ We define $g:\bigcup_{s\in S}U_s\to R^n$ as $g(x)=\sum_{s\in A_x}\phi_s(x)f_s(x)$. Then $g$ is the desired smooth extension of $f$.
I tried to modify this argument to make it work for a general manifold $N$ (note there is no addition or scalar multiplication in $N$ so this $g$ requires some modification) but I couldn't. So my question is: Is exercise 1.74 true when $N$ is a general manifold or is there a counterexample?