How to Prove this Map is an Embedding of a Smooth Manifold? I have run into a problem in my differential geometry book.

Let $M$ be a smooth manifold and $F={C^\infty }(M,\mathbb R)$. 
Define a mapping $i:M \to {\mathbb R^F}$ by ${i_f}(x) = f(x)$ for $x
> \in M,f \in F$, then $i$ is an embedding. 
($\mathbb R^F$ has product topology and $i_f$ means the component.)

The injectivity and continuity are not hard. How can I prove that the mapping is an embedding?
 A: Let $K\subset M$ be closed. Let $K_f = \overline{f(K)}$ the closure of $f(K)$. Define the set $L \subset \mathbb{R}^F$ by 
$$ L = \cap_{f\in F} p_f^{-1} K_f $$
where $p_f$ is the projection map on the coordinate $f\in F$ from $\mathbb{R}^F\to\mathbb{R}$. Continuity of the projection ensures that $L$ is closed. It suffices to show that $i^{-1}(L) = K$, since obviously $i(K) \subset L$. 
Observe that $p_f L \subset K_f$. 
Let $y\in M\setminus K$. Since a topological manifold is Tychonoff, there exists a continuous function such that $h(F) = 0$ and $h(y) = 1$. Going through the construction for bump functions one sees that on a smooth manifold you can take $h$ to be smooth (hence $h\in F$). (Take a coordinate chart around $y$, find an open $U$ disjoint from $K$ whose closure is inside the chart. Make bump function relative to the compact $\{y\}$ and open $U$, extend by 0 outside the chart.) Hence $h(y) \not\in K_h$, hence $i(y) \not\in L$. 
So $L\cap i(M) = i(K)$ is closed, so $i^{-1}$ is continuous, and so $i$ is a homeomorphism to its image.  
