Determining if a differential equation has unique solution

Our teacher asked a seemingly simple question:

What is the value of $f(2)~$ if $~f( f(x) ) = 16x-15~$?

I found a solution assuming $f(x)$ in the form of $ax+b$, but how do I show that $f(x)$ must be in that form?

I thought of taking derivative of both sides and reached

$$f'(f(x)) = \frac{16}{ f'(x) }$$

How can I show that this function has a unique solution or it doesn't have a unique solution?


Apply $f$ from the inside and outside, set $x=f(w)$ then $$ f(f(f(w)))=16f(w)-15 $$ and also $$ f(f(f(x)))=f(16x-15) $$ so that $f(16x-15)=16f(x)-15$, from which one concludes directly $f(1)=1$. Set $g(x)=f(1+x)-1$, then $16g(x)=f(1+16x)-1=g(16x)$, $g(0)=0$ or equivalently $$ g(x)=16\,g\biggl(\frac{x}{16}\biggr)=16^n\,g\biggl(\frac{x}{16^n}\biggr)~~\forall n\in\Bbb N $$ Assuming differentiability of $f$ and thus of $g$ one concludes that $g(x)=ax$, $f(x)=ax+1-a$, validating your first guess as the only solution, $$ f(f(x))=a(ax+1-a)+1-a=a^2x+1-a^2\implies a=\pm4, ~~f(2)=a+1\in\{-3,5\}. $$