This is probably a very basic question, but I don't know the answer and I also don't see how it might be obvious (which it very well might be).
Given a topological space $X$, it is always true that the set of all its continuous self-maps is generated by its subset consisting of
- the self-hemeomorphisms of prime order (i.e., there exists some prime number $p$ such that $f^p = id$ while $f^k \neq id$ for all $k \leq p$) and
- the continuous retractions (i.e. $f^2 = f$).
Is the answer to this a well-known fact? If its not always true, is there a chracterization of the cases where it is true? All I know is that it is true if the topology is discrete or trivial (so we are essentially talking about sets and functions), although is think that it requires AC.
I should add that, by generation, I mean everything you can get by applying composition finitely many times.