$f(x)=x^3-x+1$
$f'(x)=3x^2-1$, It will be zero at $x=1/3,-1/3$
$f"(x)=6x,$ so $1/3$ is a local minima and $-1/3$ a local maxima. It can have $1$ root or $3$ roots $y=|x^3-x+1|$, the function will have one local maxima.
$y=f(|x|)$, the only difference between this function and the second one is that while the second one becomes "v shaped" at the x axis, the turning point for this function is the y axis. Since the minima occurs before $y=0$, it will have two minima.
The number of roots doesn't affect the shape of the function so I can solve the second part and third parts. However my book says that my answers are wrong, where is my logic going wrong? Please help, thanks :)
Edit: Made some corrections
Edit:More corrections
$f(x) = x^3 - x + 1\\ f'(x) = 3x^2 - 1\\ f''(x) = 6x\\ \lim_\limits{x\to \infty} = \infty\\ \lim_\limits{x\to -\infty} = -\infty\\ f(0) = 1$
$f'(x) = 0$ when $x = \pm \sqrt {\frac 13}$
The second derivative test says that $x = +\sqrt {\frac 13}$ is a local minimum and $x = -\sqrt {\frac 13}$ is a local maximum
If $f(\sqrt{\frac 13}) > 0$ then $f(x)$ has 1 real root.
Analysis of the end behavior tells us that that root will be on the left side of the maximum.
If $f(\sqrt{\frac 13}) < 0$ then $f(x)$ has 3 real roots. The end behavior tells us one root on the left side of the maximum, one between the max and the min, and one on the right side of the minimum.
$f(|x|)$ will have as many roots for $x\in(-\infty, 0)$ as $f(x)$ has for $x\in (0,\infty)$
$|f(x)|$ will have additional critical points whenever $f(x) = 0$ these will be minima.
if $x_0$ is a minimum of $f(x)$ and $f(x_0)< 0$ then $f(x_0)$ will be a maximum.