$$f(x) = x^3 - 3x + 1$$
$$f'(x) = 3x^2 - 3 = 3(x-1)(x+1)$$
The critical points are $$x = 1$$ and $$x = -1$$.
• Local maximum value: $$f(-1) = (-1)^3 - 3(-1) + 1 = 3$$
• Local minimum value: $$f(1) = (1)^3 - 3(1) + 1 = -1$$
Since $$f(-1) > 0$$ and $$f(1) < 0$$, the cubic equation $$f(x) = 0$$ has 3 distinct real roots.
Let's denote them as $$\alpha, \beta, \gamma$$.).
• $$f(-2) = -8 + 6 + 1 = -1 < 0$$ and $$f(-1) = 3 > 0 \implies \alpha \in (-2, -1)$$
• $$f(0) = 1 > 0$$ and $$f(1) = -1 < 0 \implies \beta \in (0, 1)$$
• $$f(1) = -1 < 0$$ and $$f(2) = 8 - 6 + 1 = 3 > 0 \implies \gamma \in (1, 2)$$
So, $$-2 < \alpha < -1$$, $$0 < \beta < 1$$, and $$1 < \gamma < 2$$.
We want to find the number of real roots for $$f(f(x)) = 0$$.
$$f(x) = \alpha \quad \text{or} \quad f(x) = \beta \quad \text{or} \quad f(x) = \gamma$$
Now, we analyze how many times the horizontal lines $$y = \alpha$$, $$y = \beta$$, and $$y = \gamma$$ intersect the graph of $$y = f(x)$$. Remember that the local maximum of $$f(x)$$ is $$3$$ and the local minimum is $$-1$$.
• For $$f(x) = \alpha$$: Since $$\alpha \in (-2, -1)$$, the line $$y = \alpha$$ lies entirely below the local minimum ($$y = -1$$). A horizontal line below the local minimum intersects the cubic curve exactly 1 time.
• For $$f(x) = \beta$$: Since $$\beta \in (0, 1)$$, the line $$y = \beta$$ lies strictly between the local minimum ($$-1$$) and the local maximum ($$3$$). A horizontal line in this range intersects the cubic curve exactly 3 times.
• For $$f(x) = \gamma$$: Since $$\gamma \in (1, 2)$$, the line $$y = \gamma$$ also lies strictly between the local minimum ($$-1$$) and the local maximum ($$3$$). Therefore, it also intersects the curve exactly 3 times.
$$\text{Total roots} = 1 (\text{from } \alpha) + 3 (\text{from } \beta) + 3 (\text{from } \gamma) = 7 \text{ roots}$$
Total intersections = $$1 + 3 + 3 = 7$$.