What functions satisfy the functional equation $f(x)-g(x)=f\big(g(x)\big)$? How could I find an $f(x)$ and $g(x)$ that satisfy this?
$$f(x)-g(x)=f\big(g(x)\big)$$
 A: Hint:
Try $f(x)=ax$ and $g(x)=bx$ and find out what values of $a,b$ will do.
A: For polynomial degree $0$:


*

*$f(x)=a$

*$g(x)=b$

*$f(g(x))=f(b)=a$

*$f(x)-g(x)=a-b$

*$f(g(x))=f(x)-g(x) \implies a=a-b \implies b=0$

*So you can choose $[f(x)=a]$ and $[g(x)=0]$ for any $[a\in\mathbb{R}]$


For polynomial degree $1$:


*

*$f(x)=ax$

*$g(x)=bx$

*$f(g(x))=f(bx)=abx$

*$f(x)-g(x)=ax-bx$

*$f(g(x))=f(x)-g(x) \implies abx=ax-bx \implies b=\frac{a}{a+1}$

*So you can choose $[f(x)=ax]$ and $[g(x)=\frac{ax}{a+1}]$ for any $[a\in\mathbb{R},a\neq-1]$

A: 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.
A: For polynomial degree 2:  


*

*$f(x)=ax^2+bx+c$, $g(x)=x+d$  


Substitute and find values for $a,b,c,d$
