Topological spaces $(X,\tau)$ where $|\text{Cont}(X,X)| = |X|$ Let $(X,\tau)$ be a topological space. Let $\text{Cont}(X,X)$ denote the set of continuous functions $f:X\to X$. 
What can be said about spaces $(X,\tau)$ where $|\text{Cont}(X,X)| = |X|$? For instance, is it impossible that they are zero-dimensional? (Note that trivially spaces with $|\text{Cont}(X,X)| = |X|$ must be infinite, because all constant functions as well as the identity are members of $\text{Cont}(X,X)$.)
 A: If $X$ denotes the Cantor set, then $\mathfrak{c} = |X|=|{\rm Cont}(X,X)|$, so yes, such spaces can be zero-dimensional. You may replace $X$ with any separable metric space of cardinality continuum. What is your motivation?
A: Suppose that $\lambda$ is an infinite cardinal with $\lambda^{\aleph_{0}}=\lambda$. Then Saharon Shelah has shown in his paper Existence of endo-rigid Boolean algebras that there is some Boolean algebra $B$ with $|B|=\lambda$ but where the only endomorphisms $f:B\rightarrow B$ are the trivial endomorphisms. When we transfer by Stone duality these facts over to topological spaces, for each infinite cardinal $\lambda$ with $\lambda^{\aleph_{0}}=\lambda$, there is a compact totally disconnected space $X$ with $w(X)=\lambda$ (here $w$ denotes the weight of the space) but where the only continuous maps $f:X\rightarrow X$ are the mappings where there is some partition $A_{1},...,A_{n}$ of $X$ into clopen sets where $f|_{A_{i}}$ is a constant function or where $f|_{A_{i}}$ is the identity function for each $i\in\{1,...,n\}$ (i.e. the only mappings are the trivial mappings). Take note that if $X$ is a compact space, then $w(X)\leq|X|$ and if $X$ is compact and totally disconnected, then $|\mathfrak{B}(X)|\leq|X|$ where $\mathfrak{B}(X)$ is the Boolean algebra of clopen subsets of $X$. Therefore if $X$ is a compact zero-dimensional space where the only mappings $f:X\rightarrow X$ are the trivial mappings, then $|C(X,X)|=|X|$ since there are at most $|X|$ ways to partition $X$ into finitely many clopen sets.
A: 
E-D-I-T 1   @RasmusBentmann has pointed out to my error (in the $\,T_0\,$ case (I considered $\ f(X)\ $ instead of $X).\ $ Thus virtually nothing of my attempt is left. Perhaps Rasmus Bentmann can post his proof if it's ready. I'll have to think a bit more about the situation. Perhaps I'll remove my post unless I can provide a correct result, either one pretty soon.

*

E-D-I-T 2   My "proof" was false. Eric Vofsey has provided a correct proof though in a comment below--I hope that Eric will his argument into an Answer (then I'll remove my answer immediately upon seen it, and with a relief).

*
THEOREM   $\ \left|Cont(X\ X)\right|\ \ge\ |X|+2\,\ $ for every finite topological space $\ X\ $ such that $\ |X|\ge 3$.
PROOF   We need to show that there is a continuous function $\ f:X\rightarrow X\ $ such that it is not the identity, nor constant.
First, let  $\ X\ $ be not a $T_0$-space, i.e. there are two different points $\ a\ b\in X\ $ such $\ \left|G\cap\{a\ b\}\right|\ne 1\ $ for arbitrary open $\ G\subseteq X.\ $ Define $\ f:X\rightarrow X\ $ by conditions:


*

*$\ f\,|\,X\!\setminus\!\{a\}\ $ is the identity on $\ X\!\setminus\!\{a\}$

*$\ f(a)\, :=\, b$


Then obviously $\ f^{-1}(G)\,=\,G\ $ for every open $\ G\subseteq X.\ $ Thus $\ f\ $ is continuous, it's not an identity on $\ X,\ $ and it's not a constant map (since $\ |X|\ge 3$. Thus the theorem holds in this case.
Now let $\ X\ $ be a $T_0$-space. Then see the Eric's argument in the comment below (until and if Eric expands his comment into an Answer).
A: If a Hausdorff space $\ X\ $ admits a dense subset $ A\subseteq X\ $ such that
$$|X|^{|A|}\ =\ |X|$$
then indeed $\ \left|Cont(X\ X)\right|\  =\ |X|$.
This holds in particular for the separable metric spaces of cardinality continuum, as was already noted by Tomek Kania in the first Answer.
