For a topological space $X$, let $C(X)$ denote the ring of continuous functions $X\to\mathbb{R}$, equipped with pointwise addition and multiplication. This question is related to this one of Noah Schweber's; in particular, the question arises from trying to understand how much topological data about $X$ is encoded in the first-order theory of the ring $C(X)$. For example, $C(X)$ has a non-trivial idempotent if and only if $X$ is disconnected. A natural question to ask is when the first-order theory of $C(X)$ can also detect whether $X$ is compact, and this is the context in which the question below arises. For further elaboration and additional context, see Noah's post and the answers and comments below it.
Let $[0,1]$ and $(0,1)$ be the closed and open unit intervals in $\mathbb{R}$. Note that there is an injective ring morphism $\iota:C([0,1])\hookrightarrow C((0,1))$ that takes a map $\alpha:[0,1]\to\mathbb{R}$ to its restriction $\alpha|_{(0,1)}$.
Question: Is the map $\iota$ elementary? If the answer is no, do we nonetheless have an elementary equivalence $C([0,1])\equiv C((0,1))$?
I suspect a negative answer, but I don't see a path for showing this. A natural first idea is to somehow try to exploit that $\operatorname{im}\alpha\subseteq\mathbb{R}$ is bounded for every $\alpha\in C([0,1])$. So, for example, one can define a formula $$u>v\equiv \exists w\big[u-v=w^2\big]\wedge\exists w\big[(u-v)w=1\big].$$ Then, for any space $X$ and any continuous $\alpha,\beta:X \to\mathbb{R}$, we have $C(X)\models\alpha>\beta$ if and only if $\alpha(x)>\beta(x)$ for each $x\in X$. Indeed, $C(X)\models \exists w[\alpha-\beta=w^2]$ if and only if $\alpha(x)\geqslant\beta(x)$ for each $x\in X$, and $C(X)\models \exists w[(\alpha-\beta)w=1]$ if and only if $\alpha(x)\neq\beta(x)$ for each $x\in X$.
With this in hand, it is fairly straightforward to come up with a first-order theory that is satisfiable in $C((0,1))$ but not in $C([0,1])$, provided we are willing to add an additional constant symbol to our language. Indeed, let $a$ be a new constant symbol, and define a theory $T$ in the language of rings along with $a$ by taking $\neg(a<n)\in T$ for each $n\in\omega$. Then realizing $a$ as any homeomorphism $(0,1)\to\mathbb{R}$ will make $C((0,1))$ into a model of $T$, but no realization of $a$ can do the same for $C([0,1])$, since any continuous image of $[0,1]$ in $\mathbb{R}$ is bounded.
However, this is of course not enough to show that $C([0,1])\not\equiv C((0,1))$ as rings, and I don't see an easy way of extending the argument. If there were some way to uniformly define the subring $\mathbb{R}$ in $C([0,1])$ and $C((0,1))$, then we would be done: if $\theta(w)$ were such a definition, then $C([0,1])$ would be a model of the sentence $\forall v\exists w[\theta(w)\wedge (w>v)]$ and $C((0,1))$ would be a model of its negation. But I'm struggling to come up with such a formula $\theta$, and I'm not even convinced it can be done. Any insight, either on this approach or on a different one, would be much appreciated.