This is a follow-up to this question: [For what sets $X$ do there exist a pair of functions from $X$ to $X$ with the identity being the only function that commutes with both?](https://mathoverflow.net/questions/358057/for-what-sets-x-do-there-exist-a-pair-of-functions-from-x-to-x-with-the-id)


Let $X$ be a set, and $X^X$ the monoid of self-maps $X\to X$ (also known as full transformation monoid of $X$). In my answer to the above question, I checked that there exists a pair in $X^X$ whose centralizer is reduced to $\{\mathrm{id}\_X\}$. Of course we can't expect this with a single element since it commutes with its own powers. So the question (which I initially asked [in a comment](https://mathoverflow.net/questions/358057/for-what-sets-x-do-there-exist-a-pair-of-functions-from-x-to-x-with-the-id#comment902567_358078)) is



> 
> Let $X$ be a set with $|X|>c\,(=2^{\aleph\_0})$. Does there exist $f\in X^X$ whose centralizer is reduced to $\{f^n:n\ge 0\}$? Or at the opposite, is it true that every $f\in X^X$ has a centralizer cardinal $2^{|X|}$?
> 
> 
> 



Centralizer of a single element in the monoid of self-maps of a set
Let $|X| > \mathbb{N}$ and $f \in X^X$, we construct a function $g$ that commutes with $f$ but is not a power of $f$. Let $G$ be the directed graph of $f$. Split $G$ into connected components. Call a connected component boring if it is of the form $a\_1, a\_2, \cdots$ or $\{a\_i\}\_{i \in \mathbb{Z}}$ with $f(a\_i) = a\_{i+1}$. If $G$ has no non-boring components, then for size reasons, two must be isomorphic so we can take $g$ to be an isomorphism between the two and the identity on the rest of $X$. So suppose $C$ is a non-boring component and consider three cases


1: There is an $x \in C$ with $f^{-1}(x) = \emptyset$. Then since $C$ is not boring, there is an $n \geq 1$ with $y \in f^{-1}f^n(x)$ and $y \notin\{x, f(x), f^2(x), \cdots\}$. Then we can take $g(x) = y$ and for $z \neq x, g(z) = f^{n-1}(z)$.


2: 1 is not the case and $C$ contains no cycles. Then let $\{a\_i\}\_{i \in \mathbb{Z}} \subset C$ be a sequence with $f(a\_i) = a\_{i+1}$. For every element $c \in C$, let $d(c)$ denote the minimal non-negative integer for which $f^{d(c)}(c) \in \{a\_i\}\_{i \in \mathbb{Z}}$ and let $r(c)$ be the minimal integer for for which $f^{d(c)}(c) = a\_{r(c)}$. Set $g(c) = a\_{r(c) - d(c)}$. Since there is an infinite chain disjoint from $\{a\_i\}\_{i \in \mathbb{Z}}$, for every $n \geq 0$, $f^n$ sends some element outside $\{a\_i\}\_{i \in \mathbb{Z}}$ so $g$ commutes with $f$ but is not a power of $f$.


3: 1 is not the case and $C$ contains a cycle. Then there exists $\{a\_i\}\_{i \in \mathbb{Z}} \subset C$ with $f(a\_i) = a\_{i+1}$, $a\_1$ is in a cycle and $a\_j$ is not in a cycle for $j < 1$. Let $k$ be the smallest positive integer greater than $1$ with $a\_1 = a\_k$. For every element $c \in C$, let $d(c)$ denote the minimal non-negative integer for which $f^{d(c)}(c) \in \{a\_i\}\_{i \in \mathbb{Z}}$ and let $r(c)$ be the minimal integer for for which $f^{d(c)}(c) = a\_{r(c)}$. Set $g(c) = a\_{r(c) - d(c)}$. For the reasons in 2, $g$ commutes with $f$ but is not a power of $f$. 


