$f(x)=x^3-3x+1$
Step 1:
$f'(x)=3x^2-3=3(x^2-1)=3(x+1)(x-1)$
$f'(x)=0\;when \;x=-1,1$
Step 2:
Interval $-\infty < x < -1$
$(x+1)\;= -$
$(x-1)\;=-$
$f'c (x)\;=+$
Interval of inc /dec $f(x)$= $f(x)$ is increasing in $(-\infty,-1]$
Interval $-1 < x<1$
$(x+1)\;= +$
$(x-1)\;=-$
$f'c (x)\;=-$
Interval of inc /dec $f(x)$= $f(x)$ is decreasing in $[1,-1]$
Interval $1 < x <\infty$
$(x+1)\;= +$
$(x-1)\;=+$
$f'c (x)\;=+$
Interval of inc /dec $f(x)$= $f(x)$ is increasing in $[1,\infty]$
$\therefore \;f(x)$ increasing in $(- \infty,-1] \cup [1, \infty)$ and decreasing in $[-1,1]$