For any topological space $(X,\tau)$ we define $$R\_{im}(X,\tau) := \{(x,y)\in X^2: (\exists f:X\to X) \text{ continuous and surjective with } f(x) = y\}.$$
Clearly, $R\_{im}(X,\tau)$ is reflexive. This relation is also transitive because the composition of two continuous surjective maps is continuous and surjective.


Given a non-empty set $X$ and a reflexive and transitive relation $R$, is there a topology $\tau\_R$ on $X$ such that $R\_{im}(X,\tau\_R) = R$? If not, is the answer positive, if we require $R$ to be


a) an equivalence relation;


b) an ordering relation?



Reconstructing relations with the image relation of a topology
The answer is no to the general question, and also to question (b), for the following simple reason (which works whether or not the space is finite): if $f:X\to X$ is surjective and $f(x)=y$ for some $x\neq y$, then there must be some $w\neq x$ with $f(w)=x$. Thus, the relation $R\_{im}$ must have the property that whenever $x\mathrel{R\_{im}} y$ and $x\neq y$, then there must be some $w\neq x$ with $w\mathrel{R\_{im}} x$. In particular, $R\_{im}$ can have no minimal elements, and so there are numerous counterexamples to the main question and question (b).


**Update.** Meanwhile, the answer to (a) is positive for finite sets, as asked in the comments:


**Theorem.** Every equivalence relation on a finite set $X$ arises
as $R\_{im}(X,\tau)$ for some topology $\tau$ on $X$.


**Proof.** Suppose that $R$ is an equivalence relation on a finite
set $X$. We may place a linear pre-order $\trianglelefteq$ on $X$ in such
a way that $x\mathrel{R} y$ is equivalent to $x\trianglelefteq
y\trianglelefteq x$. Define the topology $\tau$ to have as open
sets exactly the upward closed sets, which have the form
$U\_x=\{y\in X\mid x\trianglelefteq y\}$, plus the empty set. (This
collection is closed under arbitrary unions and intersections.)


I claim that $R\_{im}(X,\tau)=R$. First of all, the topology does
not distinguish between points within any $R$-equivalence class,
and so we may permute within them at will. Thus, $R\subset
R\_{im}(X,\tau)$. Conversely, suppose that $f:X\to X$ is continuous
and surjective. I claim that $f$ is merely permuting within each
$R$-class. First, note that $f$ is $\trianglelefteq$-preserving:
if $f(x)=y$, then $x$ is in the preimage $f^{-1}(U\_y)$, which is
open, and so if $x\trianglelefteq x'$, then since $x'$ is in any
open set that $x$ is in, it follows that $y\trianglelefteq f(x')$,
and so we have $x\trianglelefteq x'\longrightarrow
f(x)\trianglelefteq f(x')$. From this, it follows that $f$ must
take each $R$-equivalence class into a single $R$-equivalence
class. Since $X$ is finite and $f$ is surjective, we know that $f$
is a permutation of $X$, and so $f$ must take the least $R$-class
to itself, and the next and so on, since otherwise we'd violate
the $\trianglelefteq$-preserving property. In other words, $f$ is
merely permuting the points inside each equivalence class, and so
$R\_{im}(X,\tau)\subset R$ and hence $R\_{im}(X,\tau)=R$, as
desired. **QED**


