So I was playing around with function composition, and started wondering if there was a way to split up a function in to a repeated application of another function.
Notation: Let $f^1 = f$ and $f^n = f \circ f^{n-1}$. (Basically, apply the function $n$ times)
Given a function $f: X \rightarrow X$, I am trying to find a function $g: X \rightarrow X$, such that $f = g^2$. Let's say $f$ is like differentiable and all this pretty stuff.
As a trivial example, $f(x) = x+1$ would mean $g(x) = x+\frac12$, or a solution for $f(x) = 2x$ would be $g(x) = \sqrt2 x$.
How would you go about proving that, for a given function $f$, such a $g$ does or does not exist? What about a more general case, $f = g^n$? (I suppose we could extend the notation to $f^{\frac1n}$, such that $(f^{\frac1n})^n = f$)