Algebraic topology over fields other than ${\bf R}$ Is there an algebraic topology for spaces defined
on fields other than ${\bf R}$, including totally discontinuous fields ?
By this, I am not talking about the field of coefficients,
but about the field underlying the topological space under
investigation. If we look at manifolds or complexes
constructed over a totally discontinuous field such as
${\bf Q}$ or ${\bf Q}_p$, the usual singular homology
groups are trivial.
Let me give an example of a result that is part
of algebraic topology but holds in a somewhat
more general setting than real complexes and manifolds.
The Jordan separation theorem asserts that a closed
simple curve in the real plane has a complement
that has two path-connected components, where
the paths can be taken as piecewise linear.
It has far reaching generalisations in the form
of Alexander duality in algebraic topology.
On the other hand, geometers from the beginning
of the twentieth century realised that the theorem
depends only on the incidence and order axioms
of the euclidian plane so that it actually holds
on the plane ${\bf Q}^2$ or more generally on
any plane over $K$, where $K$ is an ordered field.
Is there an homology theory that handles both that case
and the classical CW-complexes over R?
 A: First, let's observe we will need some more structured setting than bare topological spaces to make something like this work.
Here is an example that demonstrates this.
Let $K$ be a countable ordered field (say, the real algebraic numbers).
I'll write $I = [0,1]$ for the "$K$-interval" $\{\,a \in K \mid 0 \le a \le 1\,\}$.
We can also remove a point to form, say, $I \setminus \{1/2\}$.
If these spaces are meant to work the same way as in algebraic topology,
then presumably we want $I$ to be connected and $I \setminus \{1/2\}$ to be disconnected.
However, if we treat $I$ and $I \setminus \{1/2\}$ as bare topological spaces
then they are actually homeomorphic!
The reason is that both are countable dense orders with least and greatest elements,
and so we can construct a homeomorphism between them using the back-and-forth method.
One setting that works well (which Denis Nardin already mentioned in the comments) is that of semialgebraic sets over a real closed field $R$.
These are the subsets of $R^n$ that can be defined by a first-order formula in the language of an ordered ring with constants from $R$.
The allowed functions between semialgebraic sets
are the continuous functions whose graphs are semialgebraic.
Then one can show that the interval $I = [0, 1] \subseteq R$ is connected in the sense that it cannot be written as a disjoint union of two open semialgebraic subsets, even for $R \ne \mathbb{R}$,
while $I \setminus \{1/2\}$ of course can be,
and that connectedness is a semialgebraic homeomorphism invariant.
In fact far more is true--any semialgebraic set (let's say closed and bounded for simplicity) is semialgebraically homeomorphic to a finite simplicial complex,
and the homotopy classes of semialgebraic maps between simplicial complexes
are the "correct" ones (i.e., the same as if we realized the simplicial complexes as topological spaces).
In brief, semialgebraic sets model the homotopy theory of finite CW complexes,
regardless of the chosen real closed field $R$.
This theory was worked out by Delfs & Knebusch in the 1980s
(e.g. the comparison theorem is essentially contained in Locally Semialgebraic Spaces).
This theory also turns out to be not very dependent on the specific choice of semialgebraic sets.
We can replace them by the definable sets of any o-minimal structure
(more precisely, any o-minimal expansion of a real closed field).
For references see works of Baro & Otero, Edmundo & Woerheide, Piękosz, and others.
In particular, Woerheide's PhD thesis apparently contains a proof of the Jordan curve theorem in a general o-minimal structure
using the o-minimal homology theory that he developed.
Finally, some shameless self-promotion:
We might not be satisfied with the restriction to modeling only finite CW complexes.
In https://arxiv.org/abs/2108.11952, Johan Commelin and I explain
how to enlarge the category of definable sets (in a fixed o-minimal structure)
to a model category that is Quillen equivalent to simplicial sets,
and so models the homotopy theory of all spaces.
(There is also an earlier approach to enlarging the class of spaces, due to Knebusch ("weakly semialgebraic spaces") and extended to the o-minimal setting by Piękosz,
that does not produce a model category.
Forthcoming work will explain how it is related to our construction.)
A: There is an homotopy theory associated to any geometry. This can be done in various ways. but a rather systematic point of view is the one of Morel and Voevodsky.
The idea is that a geometry should define a category $V$ (whose objects are called manifolds, varieties, schemes,...) equipped with a Grothendieck topology (considering open coverings, or 'etale coverings, or fppf coverings,...). This category usually has a ring object $A^1$, "the line", which has an affine submonoid $I$ containing 0 et and 1 (could be $I=A^1$ in algebraic geometry, but $I$ could be the closed disk of radius $1$ in analytic geometry). The idea is to work with those sheaves $F$ on $V$ which are $I$-homotopy invariant: we want the projection $X\times I\to X$ to induce an equivalence $F(X)\overset{\cong}{\to} F(I\times X)$. Depending on your background you might work with simplicial sheaves equipped with a suitable model structure, or with sheaves in the sense of $\infty$-category theory (but, if you like model structures, you may produce one on sheaves of sets which is Quillen equivalent to the other two options above).
If $V$ consists of classical manifolds (differential, topological or real analytic, say) with the usual topology, we obtain a theory which is equivalent to the classical homotopy theory of good old CW-complexes. This point of view is used for very concrete, beautiful and effective reasons by Ib Madsen and Michael Weiss in their proof of the Mumford conjecture which predicts the structure of rational cohomology of the stable moduli space of Riemann surfaces, for instance.
The systematic approach by Morel and Voevodsky was designed to define a good homotopy theory over any base scheme (in particular, any ring), in which both algebraic $K$-theory and $\ell$-adic cohomology are representable, and is at the basis of motivic homotopy theory, that has grown into a topic by itself for the last couple of decades. A nice introduction with an emphasis on the concrete benefits of the motivic refinement of the theory of degree of a self map though the Witt group of the ground field has been written by Kerstin Wickelgren and Ben Williams, for instance.
The need to understand nearby cycle functors has driven people to study such homotopy theories in the context of non-archimedean analytic geometry. A specialist of this is Alberto Vezzani, who turned Scholze's tilting techniques into motivic constructions and, together with Joseph Ayoub and Martin Gallauer found a very elegant and powerful way to see nearby cycle functors through analytic techniques.
Finally, working with sheaves on reasonnable geometric object to define nice homotopy theories goes beyond the formalism of Morel and Voevodsky. There is for instance the work of Reid Barton and Johan Commelin on homotopy theories associated to o-minimal structures, or the work of David Ayala, John Francis, Nick Rozenblyum on sheaves on stratified manifolds and factorization homology.
That said, we do not need motivic techniques to define nice cohomologies: Grothendieck's idea of $\ell$-adic cohomology as a replacement of singular cohomology is robust enough to be transposed in other contexts such as (possibly non-archimedean) analytic geometry, and this is a very classical subject (from Roland Huber's foundational work for adic spaces at the end of the XXth century, to the the recent contributions of Peter Scholze and Laurent Fargues on the cohomology of diamonds).
