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$, when is the set of all its continuous self-maps generated by the subset consisting of
- the self-homeomorphisms 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? Is there a characterization of the cases where it is true?
I should add that, by generation, I mean everything you can get by applying composition finitely many times.
Edit: I originally also asked whether the statement is true or not. A counterexample was quickly presented by James Cranch (see below), so I have put more emphasis on a different part of my question, namely if there is a characterization of the cases where the statement is true.
Edit (after reading some of the answers):
Does anyone know the answer for Stone spaces? Are there any examples of Stone spaces, >where the answer to the question is no?