It is entirely reasonable to ask for a continuous and computable equality-test function on~$\mathbb R$. The unreasonable thing is to expect it to take values in the *discrete* two-element space $\mathbf 2$.

The truth-value space that we need to use is the **Sierpinski space**, for which I write $\Sigma$. It has (in the classical interpretation) two elements,

- $\top$, for which $\lbrace\top\rbrace\subset\Sigma$ is an open subspace, and
- $\bot$, for which $\lbrace\bot\rbrace\subset\Sigma$ is a closed subspace.

This space has the property that there is a three-way bijection amongst

- continuous functions $f:X\to\Sigma$;
- open subspaces $U=f^{-1}(\top)\subset X$ and
- closed subspaces $C=f^{-1}(\bot)\subset X$
for any space $X$.

This is like the subobject classifier $\Omega$ in a topos, where "open subspace" becomes "subobject". Indeed, both in set theory and topology the classification properties are rather trivial in the classical case, but become powerful definitions when read constructively.

In particular, a space $X$ is **Hausdorff** iff the diagonal $X\subset X\times X$
is closed. This happens iff there is a continuous function
$$ (\neq):X\times X\to\Sigma $$
for which
$$ (\neq)(x,y) = \bot \iff x=y. $$

In the discrete space $\mathbf 2$ both points are both open and closed and there is a **negation** function $\lnot:\mathbf 2\to\mathbf 2$ that swaps them.

All of this is meaningful in both general topology and recursion theory, replacing
- *continuous function* by *computable function* and
- *open subspace* by *recursively enumerable* subspace.

In particular, a computable function $f:X\to\Sigma$ is one that may or may not terminate but otherwise has no return value, so it is like $\mathtt{void}$ in $C$ or $\mathtt{unit}$ in ML. Then $\top$ denotes termination and $\bot$ divergence.

There is no negation function on this $\Sigma$ because if there were it would be exactly a solution of the Halting Problem.

In particular, slimton is right in saying that a positive solution to the question as originally posed would be equivalent to the
Halting Problem.

The interpretation of computation in general topology was pioneered by Dana Scott in the 1970s. Conversely, my research programme **Abstract Stone Duality** is about reformulating topology to make it equivalent to computation.

The best introduction to this programme for the general mathematician is my paper *A Lambda Calculus for Real Analysis*.