A smooth function $h: M \to \mathbb{R}$ from Partitions of Unity with $| h (x) - g (x) | <\epsilon$ for all $ x \in M​$. Let $ M $ a smooth manifold, $g: M \to \mathbb {R}$ any continuous function and $\epsilon> 0$. Prove there is a smooth function $h: M \to \mathbb{R}$ with $| h (x) - g (x) | <\epsilon$ for all $ x \in M​​$.
In general, the idea is consider a partition of unity subordinate to coverage $ \{U_x: x \ in M ​​\}$ with $U_x = \{y \in M: | g (x) -g (y) | <\epsilon \}$, but how do i build the $h$ function?
My proof stars considering $f_x: M \to \mathbb{R}$ with $f_x (g) = | g (x) -g (y) |$, so if $g$ is contiuous then $f_x$ is continuous.
Now take $U_x = f^{- 1}_x ((- \infty, \epsilon)) \subset M $ an open set. Then $ U = \{U_x: x \in M ​​\} $ is an open cover of M, and exists a partition of unity $ \{\phi_x: x \in M ​​\} $ subordinate to $ U $, where
$$ \phi_x: M \to \Bbb R $$
$$ 0 \le \phi_x \le 1 $$
$$ \text{supp} (\phi_x) \subset U_x $$
$$ \sum_ {x \in M} \phi_x = 1 $$
Let $ h = \displaystyle \sum_ {x \in M} g(x) \cdot \phi_x $ smooth, then as $ g(x) $ is constant, we have $ g(x) \cdot \phi_x: M \to \Bbb R $ is smooth.
but I don't know how to prove that $ | h (y) - g (y) | <\epsilon$ for all $y\in M ​​$.
 A: For each $x \in M$ consider the $U_x = \{ y \in M \mid |g(x) - g(y)| < \min(|\frac{g(x)}{2}|, \epsilon)\} $. Also for simplicity you can assume that $U_x$ be an open set with a compact closure. By just intersecting it with a coordinate chart around $x$. As you said $\{ U_x \}_{x \in M}$ covers the manifold.
Now consider the partition of unity subordinate to this cover. So we have a collection $\{ \Psi_x \}_{x \in M}$ of smooth functions with properties that you mentioned. Now define $h$ as $\sum_{x\in M} g(x).\Psi$. As each $\Psi$ is smooth and around each point of manifold there are finitely many non-zero members of the portion of unity, we conclude that $h$ is a smooth function. Now to show that $h$ has the desired property let $ y \in M$ then at $y$ there are only finitely many non-zere elements of the partition of unity. Let's call them $\Psi_{x_1},...,\Psi_{x_k}$. we have :
$$
   |h(y)-g(y)| \leq \sum_{i=1}^{k} |g(y)-g(x_i)|\times \Psi_{x_i}(y) < \sum_{i=1}^{k} \epsilon \times \Psi_{x_i}(y) = \epsilon .
$$
Thus $h$ is the desired function.
Note that for each $i$ we have $ y \in U_{x_i}$.
