"Compositional roots" of functions, how to define them and how many are there? Assume I am interested in solving $$(\underset{k \text{ times}}{\underbrace{g\circ \cdots \circ g)}}(x) = g^{\circ k}(x) = f(x)$$
That is, $g$ is in some sense a function which is a $k$:th root to applying the function $f$. Applying $g$ $k$ times starting with the number $x$ does the same thing as applying $f$ once.
I suspect that without extra constraints on the behaviour of $g$ there got to exist a huge amount of candidates for $g$. Say we consider functions $f\in \mathbf{C}^2$, twice continously differentiable. Is there some way to quantify or classify the solutions $g$ depending on which space they are in?
What constraints can we put on $g$ to narrow down or make nicer the possible solutions?

Own work Some (rather trivial) ones I have found are:
$$\text{for } k = l: f(x) = x^{2^l}, g(x) = x^2$$
And of course (more generally) all polynomials on the form:
$$\text{ for } k=2, f(x) = \sum_{\forall l} a_l \left(\sum_{\forall m} a_mx^m\right)^l, \text{ have } g(x) = \sum_{\forall k} a_kx^k$$
For example maybe the most simple one turning function composition into an addition machine. Imagine a simple computer having only "increment by $b$" instruction to do addition.
$$\cases{g(x)=x+b\\f(x) = g(g(x)) = g(x)+b = (x+b)+b = x+2b}$$
These are all the conceptually most simple ones I could think of, but I am of course interested in how complicated functions $g$ could be while still fulfilling the equation.
 A: Let $f(x)$ be constant function always equal to 0.
Let $a>0$ some number. 
Consider $g(x) = ax^4$ for $x<0$ and $g(x) = 0$ for $x\geq 0$.
Then $g(g(x)) = 0$ for any $x$, while $g$ is $C^2$.
So we obtained infintely many "square roots" from 0 in terms of composition for $C^2$. I guess you need to have at least $C^\infty$ to have something more unique, but I doubt it would be enough.
Update: $C^\infty$ would not work either, since instead of $x^4$ you can use $e^{-1/x^2}$ to make $g(x)$ infinitely differentiable.
A: Let $f(x)=4x$. That's a useful function, though hardly more so than 0; more importantly, it is nontrivial.
Define $g(x)$ as some freehand monotone curve running from (1,2) to (2,4), and then use the functional equation to expand its domain to (2,4), then to (4,8) and so on. You see that it may be made infinitely differentiable everywhere (except possibly 0) in infinitely many ways.
A: For analytic functions (having a power series with nonzero radius of convergence) there is the option to use the concept of a Carleman-matrix of a function(WP). (For a very rough introduction I've an older text which I should improve much though, for instance I even did not yet know the name "Carlemanmatrix" for that matrices which I worked with -  see here) Then one can approximate roots and powers of that matrix to arrive at (approximative) formal power series for compositional roots and powers of the basic function.
In principle this reflects the Schröder's method, using that functions which are called by his name now. (Also Koenig-, Abel- and Boettcher-function, see wikipedia)
