Artificial intelligent assistant

Cancellation propriety for continuous functions. Let's say we have a continuous (onto) function $f:\mathbb{R}^n \rightarrow \mathbb{R}^n$ such that there exist $k,s \in \mathbb{N}: f^k=f^s$. Is it true that $f^{|k-s|}=id$? Is it true something similar?

If $f$ onto, then the continuous condition for $f$ is superfluous.

Since $f$ is onto, so is $f^s$.

So from the condition that $f^{s + k} = f^s$, we obtain: $f^k\circ f^s = f^{s + k} = f^s = \text{id}\circ f^s$, since $f^s$ is onto, we can cancel $f^s$ on the right to obtain $f^k = \text{id}$.

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 7a44b77132190130df38c2b6027152f4