TITLE: What functions satisfy the functional equation $f(x)-g(x)=f\big(g(x)\big)$?
QUESTION [9 upvotes]: How could I find an $f(x)$ and $g(x)$ that satisfy this?
$$f(x)-g(x)=f\big(g(x)\big)$$

REPLY [12 votes]: It may be useful to rearrange your equation as $$f(x)=g(x) + f(g(x)).\tag1$$  By taking this as the definition of $f$ and applying it repeatedly to the right-hand side, we get $$f(x) = g(x) + g(g(x)) + g(g(g(x))) + \dotsb = \sum_{k=1}^\infty g^{(k)}(x).\tag2$$ Thus, for any function $g$, we can obtain a corresponding $f$ by summing the iterates of $g$, provided that this sum converges.
A necessary (but not sufficient) condition for convergence of the sum is that the orbit of any starting point $x$, under the repeated application of $g$, must eventually tend to zero.  In particular, $g$ must not have any fixed points other than 0, and must not have any cycles or other non-point attractors.
Alas, this method does not generate all possible solutions.  A counterexample, provided by barak manos, is $g(x) = 0$, for which $f(x) = a$ satisfies equation $(1)$ for any $a \in \mathbb R$, even though equation $(2)$ yields only the solution $f(x) = 0$.
(In fact, it's easy to show that, if $g$ and $f$ satisfy equation $(1)$, then so do $g$ and $f+c$ for any constant $c$.  Thus, if equation $(1)$ has any solution for some $g$, it must have an infinite family of solutions differing by a constant term added to $f$.)
Similarly, for $g(x) = bx$, the series $(2)$ converges to $f(x) = \frac{b}{1-b}x$ only when $|b| < 1$, even though this choice of $f(x)$ actually yields a valid solution to equation $(1)$ for any $b \ne 1$.  However, it may sometimes be possible to apply more powerful summation methods to obtain formal solutions even for some functions $g$ for which this series diverges.