Does every set $X$ have a topology for which the only continuous self-surjection is the identity map? This question is a special case of Dominic van der Zypen's question Reconstructing relations with the image relation of a topology, as discussed in the comments, particularly the comment of Eric Wofsey, which explains that if the answer to this question is affirmative, then the answer to Dominic's question is also affirmative. 
Question. Does every set $X$ have a topology for which the only continuous surjection $f:X\to X$ is the identity map?
My answer to Dominic's question shows that for finite sets, the answer is affirmative, since one need only place an order on $X$, and then let the topology be the up-sets of the order. Every continuous surjection is a permutation of $X$ and order-preserving, and hence the identity. Although it is tempting to try to use the same method with well-orders on an infinite set, it doesn't quite work out in that generality, because the predecessor function on the finite height elements (otherwise fixed) will be a continuous surjection, but not the identity. 
For an extreme negative answer, I would ask: can one show that there is no topology on a countably infinite set for which the only continuous surjection is the identity map?
 A: As a very special case, I claim that there is no regular topology on a countably infinite set such that the only contiuous surjection $f:X\rightarrow X$ such that is the identity map. If $X$ is countably and regular, then $X$ is a regular Lindelof space. Since every regular Lindelof space is paracompact, the space $X$ is paracompact and hence completely regular and even realcompact. If $X$ is compact, then $X$ is isomorphic to some countable ordinal $\alpha+1$. Therefore, the mapping $g:\alpha+1\rightarrow\alpha+1$ where $g(n)=n-1$ where $n$ is a finite non-zero ordinal and $g(\beta)=\beta$ where $\beta$ is infinite or zero is a continuous surjection. 
Now assume that $X$ is not compact. Recall that a space is compact if and only if it is realcompact and pseudocompact. Therefore, since $X$ is not compact but $X$ is realcompact, the space $X$ is not pseudocompact. Furthermore, the space $X$ is zero-dimensional by the following argument: if $U$ is a neighborhood of $x$ and $f:X\rightarrow[0,1]$ is a mapping such that $f(x)=1$ and $f=0$ outside $U$, then the function $f$ is not surjective since $X$ is countable. Therefore, if $r\not\in f[X]$, then $f^{-1}[r,1]$ is a clopen set with
$x\in f^{-1}[r,1]\subseteq U$. Therefore, since $X$ is zero-dimensional but not pseudocompact, by this answer, there is a partition of $X$ into infinitely many clopen sets $(C_{n})_{n\in\mathbb{N}}$. Let $(x_{n})_{n\in\mathbb{N}}$ be an enumeration of the elements of $X$. Then let $f:X\rightarrow X$ be the mapping where we let $f(x)=x_{n}$ whenever $x\in C_{n}$. Then $f$ is generally a non-identity continuous surjection.
I conjecture that it is consistent with the negation of the continuum hypothesis that every completely regular space of cardinality below the continuum has a non-identity surjection.
A: In the article Constructions and Applications of Rigid Spaces, I (Advances in Mathematics 29, 89--130 (1978), V. Kannan and M. Rajagopalan show that if $(2^{\aleph_0})^+ < 2^{2^{\aleph_0}}$, there is a countable space $X$ such that the only non-constant continous self-map is the identity. (Of course that's a notion of rigidity that is "more rigid" than what is asked in the original post.)
A: For $X$ of cardinality at least continuum there exist such spaces, even metrizable ones. It follows immediately from a much more general result, proved by Trnková in [1]. She proves that the category of graphs admits a full embedding into the category of metrizable spaces with nonconstant maps. An inspection of the proof shows that a graph $G$ is sent to a space whose cardinality is $|G|\times\frak{c}$. Then we use the fact that there exist rigid graphs $G$ of every cardinality - this is proved in P. Vopěnka, A. Pultr and Z. Hedrlin, Commentationes Mathematicae Universitatis Carolinae 6(1965), 149-155.
[1] V. Trnková, Non-constant continuous mappings of metric or compact Hausdorff spaces, Comment. Math. Univ. Carolinae 13 (1972) 283–295.
