f[x_] := x^4 - 2  x^3 - 4  x^2 + 4  x + 4

x =.

f[x]

Df[x_]  :=  D[f[x], x]

g = Df[x]

Plot[f[x], {x, -4, 4}]

Plot[g, {x, -3, 3}]

x = 0.0;
xtol = 0.001;
deltax = 1000;
i = 1;
max = 20;
While[(i ≤  max)  && (deltax  >  
            xtol), 
xnew =  
        x  -  (f[x]/g); 
deltax  =  
        Abs[xnew - x]; 
Print[N[x],  "   ", 
        N[xnew], "   ",  N[g], "  ",  
        N[deltax]]; 
x =  xnew; 
i = 
        i + 1]

Solve[f[xx] == 0, xx]

N[%]

x =.

Solve[g == 0, x];

N[%]