I am looking for an example showingthat 
 a function $f$ which is $C^\infty$ on a submanifold $N$ of $M$, but it cannot be written as 
the restriction of a $C^\infty$-function on $M$.



A $C^\infty$-function on a submanifold which is not the restriction of a a $C^\infty$ on $M$ 
You can take $M = \{ z \in \mathbb{C} \colon |z|=1\}$, $N = M \setminus \{1\}$ and $f(e^{i\varphi}) = \varphi$.


