I am looking for a dense sub-algebra $B$ in $C\_{b}((0,1))$ in uniform topology such that it satisfy following requirements:


1. $B\cap C^{\infty}\_{b}((0,1))=\mathbb{R}$ (No polynomial, no bump function).


$(0,1)$ can be replaced with other connected open set.
The only thing I can come up with is nowhere differentiable function union with $\mathbb{R}$, but I don't know if they form a sub-algebra.



Dense sub-algebra of $C_{b}((0,1))$ which is not smooth
Such a subalgebra can be defined. See also the end of this answer for a more general result.


Let $I=(0,1)$. In the following, an open interval means a nonempty open interval of $I$. Fix a function $f\in C\_b(I)$ with values in $[1,2]$ such that $f$ is not smooth over any open interval; for instance, $f:t\mapsto\alpha W(t)+\beta$, for $W$ a realisation of Brownian motion. Set $B$ the subset of $C\_b(I)$ consisting of functions of the form
$$a\_nf^n+\cdots+a\_1f+a\_0,$$
with $a\_1,\ldots,a\_n$ smooth and $a\_0$ constant. $B$ is clearly a subalbegra of $C\_b(I)$. We need to show that it is dense, and that its smooth functions have to be constants.


The following fact follows from considering a smooth partition of unity over $I$.



> 
> **Fact.** Given $h,\delta\in C\_b(I)$ such that $\delta>0$ over $I$, there exists $\tilde h\in C^\infty(I)$ such that $|h-\tilde h|<\delta$ over $I$.
> 
> 
> 


In particular, it will be enough to show that the closure of $B$ in $C\_b(I)$ contains all smooth functions. Let $g$ be a smooth function of $C\_b(I)$ and $\varepsilon>0$. We are looking for a function in $B$ within distance $\varepsilon$ of $g$. Using the above fact, let $\tilde f\in C^\infty(I)$ such that $2|f-\tilde f|<\min(1,\varepsilon/|g|)$. Of course $\tilde f\geq f-|f-\tilde f|\geq 1/2$. Then
$$ \left|g-\frac g{\tilde f}f\right|\leq\frac{|g|}{|\tilde f|}\cdot|\tilde f-f|<\frac{|g|}{1/2}\cdot\frac\varepsilon{2|g|}=\varepsilon,$$
so $g$ is at distance at most $\varepsilon$ of $(g/\tilde f)f\in B$, which concludes the density argument.


To show that smooth functions of $B$ are constant, here is a lemma that we'll prove later.



> 
> **Lemma.** If $h\in C\_b(I)$, $b\_n,\ldots,b\_0\in C^\infty(I)$ and $h(x)$ is a root of $b\_n(x)z^n+\cdots+b\_0(x)$ for all $x\in I$, then either $h$ is smooth over an open interval of $I$ or the $b\_i$ are all zero everywhere.
> 
> 
> 


Choose some $g\in B$. We can write it as $a\_nf^n+\cdots+a\_1f+a\_0$ for $a\_1,\ldots,a\_n$ smooth and $a\_0$ constant. Now if $g$ is smooth, then $f(x)$ is a root of $a\_n(x)z^n+\cdots+a\_1(x)z+(a\_0-g)(x)$ for all $x$, with all coefficients smooth. Since $f$ is not smooth over any open interval of $I$, the above lemma shows that all coefficients of this polynomial are zero, and in particular $g=a\_0$ is a constant.


It remains to prove the lemma. I will work by induction over $n$. If $n=0$, the result is obvious since $b\_0$ has to be zero everywhere. Suppose the result is true for a given $n$, and let us show it is true for $n+1$.


Let $h$ and $b\_{n+1},\ldots b\_0$ be as assumed in the lemma.


1. If there exists an $x\_0$ such that $h(x\_0)$ is a simple root of $b\_{n+1}(x\_0)z^{n+1}+\cdots+b\_0(x\_0)$, a classical application of the [inverse function theorem](https://en.wikipedia.org/wiki/Inverse_function_theorem#Polynomial_functions) shows that $h(x)$ depends smoothly on the vector $(b\_0(x),\ldots,b\_{n+1}(x))$, which itself depends smoothly on $x$, so $h$ is smooth over a neighbourhood of $x\_0$.
2. If such an $x\_0$ does not exist, it means that for all $x$, $h(x)$ is a root of the derivative $(n+1)b\_{n+1}(x)z^n+\cdots+2b\_2(x)z+b\_1(x)$. By the induction hypothesis, either $h$ is smooth on an open interval and we are done, or all functions $b\_1$ to $b\_{n+1}$ are zero everywhere. Since $h(x)$ is now a root of the constant polynomial $b\_0(x)$ for all $x$, $b\_0$ is zero as well, which concludes.




---


Let us rewrite that result in an abstract-ish context. Let $X$ be a topological space, and $\mathcal S\subset C(X)$ a certain notion of regularity; in the above case, $X=(0,1)$ and $\mathcal S=C^\infty(X)$. Suppose the following three conditions are met.


1. $\mathcal S$ is a local notion of regularity, in the sense that a function $f\in C(X)$ is of regularity $\mathcal S$ if $f\_{|U}$ is of regularity $\mathcal S$ for all $U$ in an open cover of $X$ (for instance, not globally Lipschitz but rather locally Lipschitz). In technical terms, $\mathcal S$ should come from a subsheaf of $U\mapsto C(U)$. Moreover, for all $s\_1,\ldots,s\_k\in\mathcal S$ and $g\in C^\infty(\mathbb R^k)$, one should have $g\circ (s\_1,\ldots,s\_k)\in\mathcal S$. In particular, $\mathcal S$ is an algebra, and $g/h\in\mathcal S$ if $g,h\in\mathcal S$, $h>0$.
2. The above fact should still hold: given $h,\delta\in C\_b(X)$ such that $\delta>0$ over $I$, there exists $\tilde h\in \mathcal S$ such that $|h-\tilde h|<\delta$ over $X$. In particular, $\tilde h$ is bounded. This holds if $\mathcal S$ admits partitions of unity (a property sometimes known as $\mathcal S$-paracompactness); as described in Theorem 16.2 of *The Convenient Setting of Global Analysis* by Kriegl and Michor, it is enough to have $X$ paracompact and $\mathcal S$ separating for closed sets (given $F\_0,F\_1\subset X$ disjont closed sets, there exists $f\in\mathcal S$ such that $f\_{|F\_i}=i$).
3. There should exist $f\in C\_b(X)$ such that $f\_{|U}$ is never of regularity $\mathcal S$, for $U\subset X$ a nonempty open subset.


Then the reasoning above shows that there exists a dense subalgebra $B\subset C\_b(X)$ such that $B\cap\mathcal S$ contains only constants.


For instance, for any second countable metric space $(X,d)$, there exists a dense subalgebra $B\subset C\_b(X)$ such that the only locally Hölder functions of $B$ ($\forall x,\exists\varepsilon,a,M>0,\forall y,z\in B\_x(\varepsilon),|h(z)-h(y)|\leq Md(y,z)^a$) are constant. Indeed, setting $\mathcal S$ the local Hölder regularity, the first point is not difficult, and the second one is done using $\mathcal S$-paracompactness (consider the locally Lipschitz function $x\mapsto d(x,F\_1)/(d(x,F\_0)+d(x,F\_1))$). We can deal with the third point using a Baire-type argument, noting that the set
$$ A(x,\varepsilon,M) = \lbrace h\in C\_b(X):\forall y,d(x,y)<\varepsilon\Rightarrow|h(y)-h(x)|\leq-1/\ln d(x,y) \rbrace $$
is closed with empty interior, and that a function that is locally Hölder over a nonempty open subset of $X$ has to belong to some $A(x\_k,2^{-\ell})$, where $\lbrace x\_0,x\_1,\ldots\rbrace$ is a dense subset of $X$.


