TITLE: Can we recover a compact smooth manifold from its ring of smooth functions?
QUESTION [23 upvotes]: It is well-known that if $X$ is a reasonably nice topological space (compact Hausdorff, say) then we can recover $X$ from the ring $C(X)$ of continuous functions $X\to\mathbb R$; see this MSE question for a discussion and problem 26 in the first chapter of Atiyah MacDonald for the construction. Is the same true for a compact smooth manifold $M$ and its ring $C^\infty(M)$ of smooth functions? More specifically,

Let $M$ and $N$ be compact smooth manifolds. If $C^\infty(M)$ and $C^\infty(N)$ are isomorphic, then are $M$ and $N$ necessarily diffeomorphic?
Can we recover the topological space $M$ from $C^\infty(M)$? If so, can we also recover the smooth structure on $M$?

REPLY [4 votes]: I want to give full steps to this problem. The answer is that one can recover $M$ from $\mathscr{C}^{\infty}(M)$ for  arbitrary manifold  $M$ (assuming second countability and Hausdorff). 

First step, recover the space. Let 
$$\Sigma=\{\textrm{non-zero $\mathbb{R}$-algebra homomoprhoism $F:\mathscr{C}^{\infty}(M)\to \mathbb{R}$}\}$$
Actually, any $F\in \Sigma$ is a calculation, say $f\mapsto f(x)$ for some fixed $x$. 

Proof. Pick a "step" smooth function $f_0: M\to \mathbb{R}$ such that for any $\lambda\in \mathbb{R}$, $f_0^{-1}(\lambda)$ is compact (with using the assumption of existence of countable partition of unity). Assume $F$ is not a calculation, then
$$\forall x\in M, \exists f_x\in\mathscr{C}^{\infty}(M),\quad  \textrm{such that}\quad f_x(x)\neq F(f_x)$$
replace $f_x$ by $f_x-F(f_x)$, one can assume that $f_x(x)\neq 0$ and $Ff_x=0$. Then
$$U_x=\{a\in M: f_x(a)\neq 0\}\ni x$$
gives a open cover of $f_0^{-1}(F(f_0))$, thus there exists finite subset $X_0$ such that $\{U_x: x\in X_0\}$ cover $f_0^{-1}(F(f_0))$, construct
$$g=(f_0-Ff_0)^2+\sum_{x\in X_0} f_x^2\qquad Fg=0$$
but for any $y\in M$, $g(y)>0$. $\square$

Second steo, recover the topology. Topologize $\Sigma$ with the weak topology such that for any $f\in \mathscr{C}^\infty(M)$, $F\mapsto F(f)$ is continuous. Then
$$\varphi: M\to \Sigma\qquad x\mapsto [f\mapsto f(x)]$$
is homoemorphism. 

Proof. Firstly, the map is surjective by above. By Urysohn's Lemma of smooth version, the map is injective. To show the map is continuous, it suffices to show $[F\mapsto F(f)]\circ \varphi=f$ is continuous, which is trivial. To show the map is closed map, for any closed $A$, by Urysohn Lemma of smooth version, there exists an $f:M\to \mathbb{R}$ such that $f^{-1}(0)=A$. This shows $\varphi(A)=[F\mapsto F(f)]^{-1}(A)$ is closed. $\square$

Third step, recover its smooth structure 1. Now pick $p\in M=\Sigma$, One can defines a equivalent relation on $\mathscr{C}^{\infty}(M)$
$$f\sim g\iff f|_U=g|_U\textrm{ for some open neighborhood $U$ around $p$}$$
Then the corresponding quotient space is exactly the germ of $\mathscr{C}^{\infty}_p(M)$. 

Proof. Let $(f,U)$ be a representation of some germ at $x$, then by times a bump function, one can show that there exists some $g$ defining all over $M$ such $g|_V=f|_V$ for some more small neighborhood of $x$. $\square$

Fourth step, recover its smooth structure 2. Now let 
$$\mathfrak{m}_p=\{f\in \mathscr{C}^{\infty}_p(M): f(p)=0\}$$
One knows that $\mathfrak{m}_p/\mathfrak{m}_{p}^2$ is exactly the cotangent space at $p$. Let $x^1,\ldots,x^n \in \mathscr{C}^{\infty}(M)$, such that their image in $\mathfrak{m}_p/\mathfrak{m}_{p}^2$ forms a basis. It must form a local coordination for $x$. 

Proof. That means $dx^1, \ldots, dx^n$ forms a basis of cotangent space at $x$. It must form a local coordination for $x$. It is a consequence of inverse maps theorem. $\square$
Once the local coordination is recovered, the proof is complete.