Here are some useful reductionsI think I can show this in general $X$, including a resolution ofheavily borrowing from Goldstern's constructions.
Lemma 1: Let $\alpha$ be the case when two distinct powerssupremum of numbers of parents of elements of $f$ are equal$X$. If, for each $x_1,x_2 \in X$, there is some $n_1,n_2$ with $f^{n_1}(x_1) = f^{n_2}(x_2)$, and $X$ is uncountably infinite, then $\alpha = |X|$.
We freely useProof: Fix an $x_0$, and for each $n$ let $Y_n$ be the set of $x$ where there exists an $m$ such that $f^n(x) = f^m(x_0)$. Then $Y_0$ is countable and $|Y_{n+1}| \leq \alpha |Y_n|= \sup(\alpha,|Y_n|)$ by the axiom of choice for many useful facts about, so inductively $|Y_n| = \sup ( \aleph_0, \alpha)$. But since the union of the $Y_n$ is $X$, the supremum of the $|Y_n|$ must be the cardinality of $X$, so since $|X|> \aleph_0$, $|X|=\alpha$. QED
Lemma 2: Let $x$ be an element of $X$, and let $\alpha$ be the number of parents of $x$. Then there are at least $\alpha$ commuting maps $g$.
Proof: The proof is a generalization of Goldstern’s argument. To an ancestor $y$ of $x$ that does not have an infinite cardinalschain of ancestors, assign an ordinal $\omega_y$ by the inductive rule that $\omega_y$ is the least ordinal greater than $\omega_z$ for all $z$ with $f(z)=y$. InLet $\omega_{y}$ for $y$ an ancestor of $x$ that does have an infinite chain of ancestors be some fixed ordinal with cardinality greater than $|X|$ - in particular, greater than all other ordinals appearing.
Then any map $g$ from the set of parents of $x$ to itself such that $\omega_{g(z)}\geq \omega_z$ for all $z$ can be extended to a commuting map $g$, by 1 setting $g(z)=z$ if $|A| + |B| \geq |X|$ then$g$ is not an ancestor of $|A| \geq X$$x$, or is a descendent of x
2 Inductively choose, for each $|B| \geq X$.$z’$ an ancestor of $x$ but not a descendent of $x$, a $g(z’)$ satisfying $\omega_{g(z’)} \geq \omega_{z' }$,
Consider the directed graph associatedThis is possible since, if $f(z')$ does not admit an infinite chain of ancestors, $\omega_{g(f(z’)} \geq \omega_{f(z’)} > \omega_{z’}$, so by definition of $\omega_{g(f(z'))}$ there exists $w’$ with $\omega_w \geq \omega_{z’}$ and $f(w)=g(f(z’)$ and we set $g(z')=w'$, while if $f(z')$ does admit an infinite chain of ancestors then $g(f(z'))$ does as well and we may choose $g(z')$ to be the parent in this chain.
There are always at least $f$$\alpha$ such maps, because there is some parent with one vertexa minimal ordinal, and we can send it to any other parent. QED
Lemma 3 If $X$ is infinite, and for each $x\in X$$x_1,x_2 \in X$, there is some $n_1,n_2$ with an edge connecting $x \to f(x)$$f^{n_1}(x_1)=f^{n_2}(x_2)$, then there are at least $|X|$ commuting endomorphisms.
IfProof: In view of Lemma 2 we may assume that the graphsupremum of the number of ancestors of $f$ has at least$|X|$ is less than $|X|$. In view of Lemma 1 we may assume that $X$ is countable. So in fact each element has a finite number of parents. If the set of maps $\{f^k | k \in \mathbb N\}$ has infinitely many connected componentsdistinct elements, therewe are at leastdone. Otherwise, $2^{|X|}$ examples by Goldstern's argument$X$ is finite, choosing eitherbecause for a permutationfixed $x_0 \in X$, each element of the singleton components or a choice$X$ satisfies one of identity versusfinitely many equations $f$ on$f^n (x) = f^m(x_0)$, each componentof which has only finitely many solutions. QED
So we may reduce to the case whenNow consider the directed graph ofassociated to $f$ has fewer than, with one vertex for each $|X|$ finite components$x\in X$, hence at leastwith an edge connecting $|X|$ elements in infinite components$x \to f(x)$. From here we may reduceThe condition of Lemma 3 is equivalent to the case when thesaying that this graph is connected. We are certainly done if the total number of elements in infinite components is $|X|$, because if for each infinite component there are at least as many endomorphisms as elements, so by multiplying them we get at least as many endomorphisms as elements in all the infinite components combined.
After this reduction,So we may assume the graph either endstotal number of elements in a $k$-cycle orfinite components is an infinite tree.
Using this, let's handle Stefan's Q1.
If $f^n = f^m$ for some $n,m$ with $n<m$, then the graph certainly ends in a $k$-cycle for $k| m-n$, and has depth $\leq n$ below that $k$-cycle$|X|$. So all elements are $n$-fold predecessors of elements in the $k$-cycle. Because finite powerstotal number of an infinite cardinal recover that cardinal, some element hasfinite components is at least $|X|$ direct predecessors. So for some $r \leq n$ it hasThen there are at least $|X|$ predecessors which are in$2^{|X|}$ examples by Goldstern's argument, choosing either a permutation of the imagesingleton components or a choice of $f^r$ but notidentity versus $f^{r+1}$$f$ on each component. We can permute these freely, as
I think in Goldstern's answer, so there are at leastfact one can get a lower bound of $|X|$ possible commuting maps$2^{|X|}$ whenever $X$ is countable but I didn't check all the steps.