For #f(x)# the local concavity/convexity is given by the sign of

#(d^2f)/(dx^2)(x)#.

For #f(x) = -x^4 + 4 x^3 - 2 x^2 - x + 5#

we have #(d^2f)/(dx^2)(x)=-4 + 24 x - 12 x^2#.

If #(d^2f)/(dx^2)(x) <0# the local curvature is qualified as convex

otherwise if #(d^2f)/(dx^2)(x) > 0# concave.

Extracting the roots of

#-4 + 24 x - 12 x^2= 0#

we get

#{(x = 1/3 (3 - sqrt[6])),(x = 1/3 (3 + sqrt[6])):}#

#x < 1/3 (3 - sqrt[6]) -> "convexity"#

#1/3 (3 - sqrt[6]) < x < 1/3 (3 + sqrt[6])->"concavity"#

#1/3 (3 + sqrt[6])< x->"convexity"#

blue #f(x)#, pink #(d^2f)/(dx^2)(x)#