As Sxerks indicated in the comments, (x-1) is a root => (x+1) is a factor.
To factor completely, a long division or synthetic division can be done to find
f(x)/(x+1)=(x^3+4x^2+5x+2)/(x+1)=x^2+3x+2 with no remainder.
Factor the resulting quadratic,
factors f(x) completely into