Ring of smooth functions on a manifold and localization with respect to a multiplicative system Take $X$ a smooth manifold and $x\in X$. It can be shown that the germ of smooth functions around $x$, $C^\infty(X)_x $ is equal to the algebraic $S^{-1}C^\infty (X)$ where $S$ is the set of smooth function that does not vanish at $x$.
But what if we take $S$ to be the set of smooth functions that does not vanish in a closed set $Y$ 
I tried to show that this led to the set $C^\infty(Y)$ but failed. Can one give me any help on this ?
 A: In analogy with the $\{x\}$ case, it shouldn't be $C^\infty(Y)$, but rather $C^\infty(X)_Y$, the "$Y$-germs". 
More precisely, let $C^\infty(X)_Y := \displaystyle\varinjlim_{U\supset Y}C^\infty(U)$. This is the ring of functions defined on an open neighbourhood of $Y$, and two such functions are declared equal if they agree on a smaller neighbourhood of $Y$. For $Y=\{x\}$ one recovers the germs at $x$. 
Then, if $S_Y$ is the multiplicative set you indicate, one should get that $C^\infty(X)\to S_Y^{-1}C^\infty(X)$ is $C^\infty(X)\to C^\infty(X)_Y$. 
To see this, first note that $S_Y$ is inverted in $C^\infty(X)_Y$. Indeed if $f$ does not vanish on $Y$, then we can find a small open neighbourhood of $Y$ on which it does not vanish (take a neighbourhood around each point of $Y$), and so it is invertible on that neighbourhood, and so in the $Y$-germs. 
Now one has to prove that we didn't do too much : let $A$ be a ring and $h: C^\infty(X) \to A$ a morphism that inverts $S_Y$, we need to see that it factors through $C^\infty(X)_Y$. So let $f$ be defined on a neighbourhood $U$ of $Y$.
One can then find a smooth function $g$ on $X$ that is $1$ on $Y$ and $0$ outside of $U$ (this is the so-called smooth Urysohn lemma - a reference would be Peter Petersen's Manifold theory). 
Then of course $g\in S_Y$ so $g$ is inverted by $h$, and $fg$ makes sense on the whole of $X$ (it is defined obviously on $U$ and by $0$ outside of $U$ and it is clearly smooth that way). Define $\tilde{h}(f) := h(fg)h(g)^{-1}$
If course if $g_1$ is another choice of $g$, then $fgg_1 = fg_1g$ and so $h(fg_1)h(g)=h(fgg_1) = h(fg)h(g_1)$, so that $h(fg)h(g)^{-1} = h(fg_1)h(_1)^{-1}$, so $\tilde{h}(f)$ doesn't depend on the choice of $g$. 
Moreover, assume $f_1$ is defined on a neighbourhood $V$ of $Y$ and $f=f_1$ on $U\cap V$
Find $g$ as above, adapted to $U\cap V$. Then $fg = f_1g$ (they agree on $U\cap V$ because $f$ and $f_1$ do, and are both zero outside $U\cap V$), therefore $\tilde{h}(f) = \tilde{h}(f_1)$. 
Finally, one must check that $\tilde{h}$ preserves sums and products, but that is quite obvious. It now follows that $\tilde{h} : C^\infty(X)_Y \to A$ is a well-defined ring morphism, and of course it agrees with $h$ on $C^\infty(X)$ (because if $f$ comes from a global map $f_0$ then $h(f_0g) = h(f_0)h(g)$).
Moreover, $\tilde{h}$ is clearly unique in doing so : if $h_1$ does too, then $h_1(f)= h_1(fg)h_1(g)^{-1} = h(fg)h(g)^{-1} = \tilde{h}(f)$ with the notations as above. 
Therefore $C^\infty(X)_Y$ satisfies the universal proeprty of $S_Y^{-1}C^\infty(X)$, so they are (uniquely, under $C^\infty(X)$) isomorphic. 
Now one may want to define $C^\infty(Y;X)$ ($C^\infty(Y)$ with a slight abuse of notation) as $C^\infty(X)_Y$ (which makes sense if you think about it) in which case we do get what you wanted in the first place. 
A: Here's a sketch. Let $\pi_x\colon \mathscr{C}^\infty(X) \to \mathscr{C}^\infty(X)_x$ be the canonical projection, and let's say that given any ring $A$, that a ring homomorphism $\phi\colon \mathscr{C}^\infty(X) \to A$ is $x$-local if for any $f \in \mathscr{C}^\infty(X)$ with $f(x) \neq 0$, $\phi(f)$ is a unit in $A$.


*

*Clearly $\pi_x$ is a surjective ring homomorphism and $\ker \pi_x$ consists of the smooth functions on $X$ which vanish in some neighborhood of $x$.

*$\pi_x$ is $x$-local: if $f$ is defined in a neighborhood of $x$ and $f(x) \neq 0$, then $f$ remains non-zero in a neighborhood of $f$. On that neighborhood, consider $g = 1/f$. Extend $f$ and $g$ by zero far from $x$ and apply $\pi_x$.

*If $\phi\colon \mathscr{C}^\infty(X) \to A$ is $x$-local, there is a unique ring homomorphism $\overline{\phi}\colon \mathscr{C}^\infty(X)_x \to A$ such that $\overline{\phi}\circ \pi_x = \phi$. This last condition ensures uniqueness and can be used to define $\overline{\phi}$, once we prove that if $f$ vanishes in a neighborhood of $x$, then $\phi(f) = 0$. Indeed, if $x \in U$ is an open set with $f|_U=0$, take an Urysohn function $\tau \in \mathscr{C}^\infty(X)$ with $\tau(x) = 1$ and $\tau|_{X\setminus U} = 0$. So $\tau f = 0$ implies $\phi(\tau f) = 0$, and $\phi(\tau)\phi(f) = 0$. But $\phi$ is $x$-local, so $\phi(\tau)$ is a unit in $A$ and thus $\phi(f)=0$.
So $\mathscr{C}^\infty(X)_x$ satisfies the universal property of the localization $S^{-1}\mathscr{C}^\infty(X)$. We are done.
