Characterizing singularities using sheaves of smooth functions
Short version:
Let $H\subset M$ be a closed subset of a smooth manifold. Equip $H$ with the sheaf $\mathcal{F}$ of smooth functions (so that a section over an open $U$ is the restriction to $U$ of a smooth function on some open of $M$). If $p\in H$ has a neighbourhood $U$ in $H$ such that $(U,\mathcal{F}_{\mid U})$ is isomorphic to a euclidean ball with its sheaf of smooth functions, then does $p$ have a neighbourhood $V\subset M$ such that $H\cap V$ is an embedded submanifold of $V$?
The whole story
I am studying a certain space $H$. This space can be identified with the inverse image of a singleton under a smooth map between smooth manifolds (by smooth, I mean $C^\infty$, although you may replace smooth by real analytic throughout the question if you wish). For the sake of notation, let us say that $f:M\to N$ is the smooth map between smooth manifolds, and that $H=f^{-1}(\{p\})$.
Now $H$ need not be a submanifold of $M$ because $p$ could be a singular value of $f$ (and in my case, it typically is). I would therefore like to split $H$ into a smooth and a singular part, and then study the smooth part as a manifold. It seems to me there is a straightforward way to do this: take the smooth part to be all points of $H$ where $f$ is submersive, and call all other points singular. Then the smooth part is an open subset of $H$ and a submanifold of $M$. Nice.
However, this approach has the disadvantage of using the map $f$ and not just the set $H$. Suppose for example that $$f:\mathbb{R}^2\to\mathbb{R}:(x,y)\mapsto x^2 ,$$ then $f^{-1}(\{0\})$ is a line, but all its points are considered singular. We could construct the same line as $g^{-1}(\{0\})$ for the map $g(x,y)=x$, and then all points are smooth. This shows why splitting $H$ using submersivity of $f$ may be a bad idea.
My problem may thus be stated as: how can we distinguish between singular and smooth points of $H$?
First proposal. One solution would be to call a point of $H$ smooth iff it has some neighbourhood $U$ in $M$ such that $H\cap U$ is a submanifold of $U$. This seems very close to geometrical intuition.
I should make an important remark, however. Although $H$ was identified with a level set of $f$, there are many other maps $f':M'\to N'$ and points $p'\in N'$ such that $H$ can also be identified with the level set $(f')^{-1}(\{p'\})$. If the splitting of $H$ is to make sense, then I want the singularities of $H$ seen as a subset of $M$ to be the same as the singularities of $H$ seen as a subset of $M'$. I know that there are smooth maps $\alpha:M\to M'$ and $\beta:M'\to M$ both of which restrict to the "identity" on $H$. It is not clear to me that the first proposal will result in the same splitting if we use $f'$ instead of $f$. This leads me to my second proposal.
Second proposal. For every open of $H$ we could look at all functions on it that are restrictions of smooth functions on some open of $M$. I believe this defines a sheaf on $H$, though I'm new to sheaves. We can then define a point to be smooth if it has some neighbourhood such that this neighbourhood equipped with the restriction of the sheaf is isomorphic to an open euclidean ball with its sheaf of smooth functions. This has the advantage that it does not depend on whether we use $f$ or $f'$ because $H$ will be equipped with the same sheaf in both cases (thanks to the maps $\alpha$ and $\beta$). It is also clear that points that are smooth according to the first proposal are also smooth according to the second. However, this proposal is not nearly as attractive to me as the first one in terms of geometrical intuition. Maybe some points that are labeled as smooth by this proposal are not supposed to be. This approach is also mentioned briefly in Thomas Klimpel's answer to Smooth structure on the topological space.
What geometrical intuition can motivate the second proposal? In particular, is every point that is smooth according to the second proposal also smooth according to the first one?
Solution 1:
Suppose $M$ is a differential manifold endowed with its sheaf $\mathcal C^\infty_M$ of smooth functions and consider an arbitrary closed subset $N\subset M$ .
Then $N$ inherits from $M$ a subsheaf $\mathcal C^\infty_N\subset \mathcal C_N$ of its sheaf of continuous functions, obtained by restricting $C^\infty$ functions on open subsets $U\subset M$ to $U\cap N$.
At a point $n\in N$ we have $C^\infty_{N,p}=C^\infty_{M,p}/\mathcal I_{M,p}$, where $\mathcal I_{M,p}$ is the ideal of germs at $n$ of smooth functions on $M$ vanishing at $n$.
The results you want are then:
1) If $N$ is a submanifold of $M$ (in the usual sense, that of your first proposal) then the ringed space $(N,C^\infty_N)$ is an abstract manifold, i.e. there exists an atlas making $N$ a manifold such that the smooth functions dictated by the atlas are exactly those dictated by the sheaf $C^\infty_N$.
2) Conversely, if the ringed space $(N,C^\infty_N)$ described above happens to be an abstract manifold, then the closed subset $N\subset M$ already was a submanifold in the usual sense.
Result 1) is essentially proved in all books on the subject (albeit in a different terminology).
Result 2) on the other hand is more difficult to locate in the literature; one possible reference is Theorem 1.17 of the book by Navarro Gonzalez
and Sancho de Salas $C^\infty$-Differentiable Spaces.
Remark
The fact you noticed that the same closed subset $N\subset M$ can be defined both as the fiber of a submersion and the fiber of a smooth function that is not a submersion is an extremely profound observation.
It is one of the core components of Grothendieck's scheme theory.
His credo, which is now universally adopted, is that the correct object to consider in algebraic geometry is the scheme, a special kind of ringed space (= topological space plus sheaf of rings).
This technique of working with ringed spaces has been adapted with huge success in complex analysis by Grauert and his school.
For some reason differential geometers have not (yet) be converted en masse to this point of view, and the book mentioned above is one of the few exceptions I'm aware of.