Order density of smooth functions among continuous functions?

Let $\mathcal{C}^0([a,b],\mathbb{R})$ be the space of all continuous functions $f:[a,b]\rightarrow\mathbb{R}$ and $\mathcal{C}^\infty([a,b],\mathbb{R})$ the subspace of all smooth functions. Define $f\leq g:\Leftrightarrow(\forall x: f(x)\leq g(x))$ and $f\ll g:\Leftrightarrow(\forall x: f(x)< g(x))$. Is the following true:

$$\forall f,h\in\mathcal{C}^0([a,b],\mathbb{R}) \;\exists g\in\mathcal{C}^\infty([a,b],\mathbb{R}): f\ll h\Rightarrow f\leq g\leq h,$$ i.e. between any two continuous functions $f\ll h:[a,b]\rightarrow\mathbb{R}$, there exists a smooth function $g$?

Does this yield that $(\mathcal{C}^r([a,b],\mathbb{R}),\leq)$ is not a lattice, for any $r\in\mathbb{N}$ (I'd like to construct a function $g$ between $|x|$ and supposed $x\vee-x$).

I haven't found this result anywhere in my calculus books, so I'd appreciate any references.

-
Much more is true. See mathoverflow.net/questions/26243/… – Pietro Majer Jul 4 at 10:26

Yes, since smooth functions are dense in $C^0([a,b])$ with the supremum norm. Since $[a,b]$ is compact, $\inf (h-f)$ is acheived somewhere in $[a,b]$ so must be positive. Thus any smooth function $g$ sufficiently near $\frac{f+h}{2}$ will suffice.

Indeed $(C^r([a,b],\mathbb R),\leq)$ is not a lattice for $r\in\mathbb N$, although I'm not sure if the fact you asked about is useful. For convenience of notation let $[a,b]=[-1,1]$. Take any function $f\in C^r([-1,1],\mathbb R)$ such that $f\geq x$ and $f\geq -x$, i.e. $f\geq |x|$. Since $f-|x|$ is continuous and nonnegative, we have either $f=|x|$ which is impossible as $|x|\notin C^r([-1,1],\mathbb R)$, or we have some interval $I$ and some $\epsilon>0$ such that $f-|x|\geq \epsilon$ on $I$. Let $g$ be a bump function on $[-1,1]$ with support $I$ and maximum value $\epsilon$. Then $f-g\in C^r([a,b],\mathbb R)$ and $f\geq f-g\geq |x|$, hence $f$ is not the least upper bound of $x$ and $-x$. Since $f$ was arbitrary, we conclude no least upper bound exists, so $C^r([a,b],\mathbb R)$ is not a lattice.

Edit: The impediment to applying the fact you asked about is that, while it would furnish a smooth function on $I$ between $f-|x|$ and $0$, such a function need not be $0$ on its endpoints and even if it is, it is not necessarily the case that extending it to $[-1,1]$ by setting it to $0$ outside $I$ would give a $C^r$ function.

-
Could you please provide any reference for this theorem? I haven't found this in Duistermaat & Kolk's Multidimensional Real Analysis 1 & 2, nor in Callahan's Advanced Calculus, which are the more advanced calculus books that I have. Should I look among Functional Analysis books? Also, what of the nonexistence of $x\vee -x$ in $\mathcal{C}^r([−1,1],\mathbb{R})$? – Leon Lampret Jul 3 at 4:36
I'm afraid I don't have any references, I just came up with the proof. And $x\vee -x$ is "the least upper bound of $x$ and $-x$", which I showed does not exist. – Alex Becker Jul 3 at 4:39
Yes, you are right, bump functions are what I really needed. Thank you! May I humbly ask for just one vote up, because I currently can't ask questions (as comments) in other threads? – Leon Lampret Jul 3 at 4:55
@LeonLampret I found a similar fact (that $C^r_b(\mathbb R,\mathbb R)$ is not a lattice) mentioned on page 7 of "Integration: A Functional Approach" by Bichteler, which can be found at books.google.com/…. The desired result follows easily. – Alex Becker Jul 3 at 4:57
Yes, they're very useful as a source of counterexamples. Essentially, they show that the derivatives of a function $\mathbb R^n$ on a subset of $\mathbb R^n$ carry only local information, even if that function is smooth. Contrast this with the case of $\mathbb C^n$, where knowing the derivatives of a differentiable function at a single point completely determines the function! – Alex Becker Jul 3 at 5:08
show 1 more comment