I was just deadly curious about a solution of a certain functional equation, or better, a question.
Given $f(x)$ and $g(x)$ as two functions domained in $A$ and $B$, and given the equation for f(x)
$$f(x)=g(f(x))$$
I found out, with some weird reasoning that
$f(x)=g^{-1}(g^{-1}(g^{-1}...(x))..)$
Now I want to ask, with which conditions is this conclusion correct? Because withour any doubt some conditions are to be met and satisfied, and certainly I have not satisfied them or mentioned them because....I do not know them!!! Any insight?