# Does possibility of extension of smooth function impose embedded nature?

Sorry for asking about problem in book.(Introduction to smooth manifold) But while I'm studying embedded submanifold I got stuck at some problem

here is problem

If for every smooth real function on S has a smooth extension to neighborhood of S then S is embedded submanifold. (Problem 5-18)

There is also hint

If S is not embedded submanifold, let p be a point of S which does not have slice chart. Let U be a neighborhood of p in S that is embedded. And consider smooth function on U supported in U and f(p)=1

I followed the hint and I extend that function to neighborhood of S I am currently guessing that I need to find some slice but it is bit hard to me, could you give me some more hints about it?