Let $f(x)=x^3-3x+1$.Find the number of distinct real roots of $f(f(f(x)))=3$ Let $f(x)=x^3-3x+1$.Find the number of distinct real roots of $f(f(f(x)))=3$
I have noticed that $f(x)=3$ has solutions $-1,-1,2$ But here how to find more roots ? in fact how to even say that they are roots of $f(f(f(x)))=3$?
If anyone has materials to share about these type of problems involving iterations, please do so.
 A: Hint: Look at the graph of $f$ and note that $f(x)=a$ has $3$ solutions for $a\in (-1,3)$, $2$ solutions for $a=-1,3$, and $1$ solution otherwise.

A: Hint: a polynomial of degree $d$ has $d$ roots, counted by multiplicity.  Roots of multiplicity $> 1$ are roots of the derivative.
EDIT: OK, not to be sadistic, here are some more details.  The roots of $f'$ are $\pm 1$;  we have $f(1) = -1$ and $f(-1) = 3$.  So $3$ and its inverse images can be pictured in the following tree, where a red arrow indicates a double root.

The leaves of the tree correspond to the distinct roots of $f(f(f(x)))-3$, and there are $15$ of them.
A: I write $a$ instead of $\{a\}$. The figure in lhs' answer shows that
$$f^{-1}(3)=\{-1,2\}\ .$$
One then obtains, by looking at the same figure,
$$f^{-1}(-1)=\{-2,1\},\quad f^{-1}(2)=\{\xi_1,\xi_2,\xi_3\}$$ with
$$\xi_1<-1,\quad -1<\xi_2<0,\quad 1<\xi_3<2\ .$$
Looking at the same figure again, we get
$$f^{-1}(-2)=\xi_4<-1,\quad f^{-1}(1)=\{\xi_5,0,\xi_6\},$$ $$ f^{-1}(\xi_1)=\xi_7,\quad f^{-1}(\xi_2)=\{\xi_8,\xi_9,\xi_{10}\},\quad f^{-1}(\xi_3)=\{\xi_{11},\xi_{12},\xi_{13}\}\ .$$
It follows that the set $f^{-3}(\{3\})\cap{\mathbb R}$ has $11$ elements. This is confirmed by the following Mathematica output:

A: Denote $f(f(x))=a$. Now you can easily solve $f(a)=3$, right? The proceed in the same way.    
I don't think there is a general approach here since $f(f(f(x)))$ is a polynomial of degree 27, which is way too high.  
A: The original posting did not state whether the roots were to be real or complex.  Taking the ideas from here and lhs' solution gives a good solution for the real case.
Consider the following: The roots of $f'(x)=3x^2+3$ are $\pm 1$.  $f(1)=-1$ and $f(-1)=2$.  Therefore, if $a\not=-1,3$, then $f(x)=a$ has $3$ distinct roots.
For $f(x)=3$, there are two distinct roots ($-1$ with multiplicity $2$ and $2$ with multiplicity $1$).  Similarly, for $f(x)=-1$, there are two distinct roots ($-2$ with multiplicity $1$ and $1$ with multiplicity $2$).
We work backwards:


*

*Step 1: Starting from $f(x)=3$, we see that there are two distinct roots, $-1$ and $2$.

*Step 2: $f(x)=-1$ has two distinct roots, $-2$ and $1$.  $f(x)=2$ has $3$ distinct roots as $3$ is not $-1$ or $2$.  None of the roots of $3$ is $2$ or $-1$.

*Step 3: There are $5$ roots at step $2$, none of which are $-1$ or $2$.  Therefore, each of them has $3$ preimages, leading to $15$ possible values for $x$.
A: The exact solutions are the roots of the polynomial
? print(h)
x^27 - 27*x^25 + 9*x^24 + 324*x^23 - 216*x^22 - 2241*x^21 + 2268*x^20 + 9639*x^1
9 - 13584*x^18 - 25515*x^17 + 50598*x^16 + 35703*x^15 - 119232*x^14 - 1917*x^13
+ 170721*x^12 - 80352*x^11 - 127980*x^10 + 122958*x^9 + 22599*x^8 - 66339*x^7 +
20412*x^6 + 4374*x^5 - 2187*x^4 
?

Its factorization is 
? factor(h)
%33 =
[                                                          x 4]

[                                                    x^2 - 3 4]

[                                              x^3 - 3*x + 3 2]

[x^9 - 9*x^7 + 3*x^6 + 27*x^5 - 18*x^4 - 27*x^3 + 27*x^2 - 3 1]

?

The polynomial has $11$ real roots, $6$ negative and $4$ positive ones.
You can determine the roots of the $4$ polynomials numerically.
