It is given that f(x) = x^3 - 3x + 1 .
Find the number of real roots of f(f(x))
f(x) has three real roots at x=-1.8794, 0.3473, and 1.5321
f(f(x)) can have up to three real roots corresponding to each root of f(x). Then we want to know for which values v does the equation f(x)=v have three real roots. This will occur when the line y=v intersects the curve y=f(x) three times, specifically when the line is between the two relative extrema.
f'(x) = 3x^2 - 3. f'(x)=0 has roots x=1 and x=-1. Then the relative extrema of f(x) are (1,-1) and (-1,3). The y-coordiantes denote the range we seek: f(x)=v will have three real roots when -1<v<3.
Two of the three roots are in that interval, the other is outside. Then the total number of real roots of f(f(x)) is then 2*3 + 1*1 = 7 real roots.