Is there an infinite topological space with only countably many continuous functions to itself? Cross-posted from MSE.
Is there an infinite countable topological space $X$ with only countably many continuous functions to itself?
It cannot be a metrizable space. Another large class of examples that I know of are Alexandrov topologies, however each Alexandrov topology corresponds to a preorder, and the continuous maps between two Alexandrov topologies correspond to the morphisms between the preorders. An infinite countable preorder has always $2^{\aleph_0}$ endomorphisms, hence I cannot find a counterexample there either. It also cannot be a filter (+ the empty set), because any function which restricts to the identity on a set in the filter is continuous (thanks to Eric Wofsey for this last fact).
Using the $\pi$-Base, an online database of topological spaces inspired by the book Counterexamples in topology and expanding it, I obtained this list of possible spaces. I proved for every one of these spaces that there were too many continuous maps, except for the Relatively prime integer topology (also known as the Golomb space) and the Prime integer topology. The first one was proved to have too many continuous maps, and the second one is very similar to the first one, so I don't place much hope on it. We need to look somewhere else.
On MSE, Mirko indicated the existence of the following paper: 
ADVANCES IN MATHEMATICS 29 (1978), 89-130 
Constructions and Applications of Rigid Spaces, I 
V. Kannan, M. Rajagopalan 
https://www.sciencedirect.com/science/article/pii/0001870878900063
In it, it is proven (Theorem 2.5.6) that, for any cardinal $\kappa$, if $(2^\kappa)^+ < 2^{2^\kappa}$, then there is a Hausdorff topological space of cardinality $\kappa$ which is strongly rigid, i.e. such that any continuous endofunction is either constant or the identity, which is a lot stronger than what we are trying to prove.
 A: A partial answer: the only place where Kannan and Rajagopalan use the inequality $(2^\kappa)^+<2^{2^\kappa}$ is in the application of the Theorem on page 121. That theorem is a consequence of Corollary 10.15 in Comfort and Negrepontis' The Theory of Ultrafilters. However the particular case that they use can be proven without an appeal to that book.
They show that for their set $F$ one can find a partition $\mathcal{A}$ of $\kappa$ into $\kappa$ many sets of cardinality $\kappa$ such that $\bar A\cap F\neq\emptyset$ for all $A\in\mathcal{A}$. Using that the space $\{0,1\}^{2^\kappa}$ has a dense subset of cardinality $\kappa$ one can map $\kappa$ onto a dense subset of that cube such that $\mathcal{A}$ is the set of point-inverses of that map, call it $f$. Then $\beta f$ not only maps $\beta\kappa$ onto that cube it also maps $F$ onto it. Take a closed subset $K$ of $F$ such that $f$ is surjective on $K$ and irreducible.
For every $\alpha<2^\kappa$ let $I_\alpha=\{\beta\in\kappa:\pi_\alpha(f(\beta))=1\}$ and $J_\alpha=\kappa\setminus I_\alpha$.
Then $\bigl\{(I_\alpha,J_\alpha):\alpha<2^\kappa\bigr\}$ is an independent family; even independent modulo the filter $\mathcal{F}=\{X\subseteq\kappa:K\subseteq\bar X\}$.
The proofs of Theorems 2.2 and 2.7 in K. Kunen, Ultrafilters and independent sets,  Trans. Amer. Math. Soc. 172 (1972), 299–306.  go through with $\mathcal{F}$ as its starting point, so that $K$ contains a set of $2^\kappa$ many Rudin-Keisler incomparable ultrafilters.
Now specialize this to $\kappa=\omega_0$ and you have a ZFC-construction of the space in Kannan and Rajagopalan's Theorem 2.5.6.
A: The answer to this question is affirmative: there exists a countable Hausdorff space $X$ such that every continuous map $X\to X$ is either constant or the identity.
Many such spaces are constructed in this preprint of Banakh and Stelmakh,
using the existence of continuum many Rudin-Keisler incomparable ultrafilters, like in the answer of K.P. Hart. Unfortunately, preparing the preprint (with my coauthor) took too much time (almost 3 months), so I has been late with my answer :(
