Plotting with a ColorFunction does not draw the curve, therefore you must draw the curve separately and then use Show.
f[x_] = x^Sin[x];
mm1 = {x, f[x]} /. FindRoot[f'[x] == 0, {x, 2}] ; mm2 = {x, f[x]} /.
FindRoot[f'[x] == 0, {x, 8}];
mm3 = {x, f[x]} /. FindRoot[f'[x] == 0, {x, 14}];
r11 = {x, f[x]} /. FindRoot[f''[x] == 0, {x, 1}] ; r12 = {x, f[x]} /.
FindRoot[f''[x] == 0, {x, 3}];
r21 = {x, f[x]} /. FindRoot[f''[x] == 0, {x, 7}]; r22 = {x, f[x]} /.
FindRoot[f''[x] == 0, {x, 8.5}];
r31 = {x, f[x]} /.
FindRoot[f''[x] == 0, {x, 13.5}]; r32 = {x, f[x]} /.
FindRoot[f''[x] == 0, {x, 15}];
l11 = {{x - 1, f[x] - f'[x]}, {x + 1, f[x] + f'[x]}} /. x -> r11[[1]];
l12 = {{x - 1, f[x] - f'[x]}, {x + 1, f[x] + f'[x]}} /. x -> r12[[1]];
l21 = {{x - 1, f[x] - f'[x]}, {x + 1, f[x] + f'[x]}} /. x -> r21[[1]];
l22 = {{x - 1, f[x] - f'[x]}, {x + 1, f[x] + f'[x]}} /. x -> r22[[1]];
l31 = {{x - 1, f[x] - f'[x]}, {x + 1, f[x] + f'[x]}} /. x -> r31[[1]];
l32 = {{x - 1, f[x] - f'[x]}, {x + 1, f[x] + f'[x]}} /. x -> r32[[1]];
col = Function[{x, y},
Piecewise[{{Orange, x < r11[[1]]}, {LightGray,
r11[[1]] < x < r12[[1]]}, {Orange,
r12[[1]] < x < r21[[1]]}, {LightGray,
r21[[1]] < x < r22[[1]]}, {Orange,
r22[[1]] < x < r31[[1]]}, {LightGray,
r31[[1]] < x < r32[[1]]}, {Orange, r32[[1]] < x}}]];
Show[
Plot[f[x], {x, 0, 16}, ColorFunction -> col, Filling -> Axis,
ColorFunctionScaling -> False,
Epilog -> {{PointSize[0.01], Blue,
Point[{r11, r12, r21, r22, r31, r32}], Red,
Point[{mm1, mm2, mm3}]},Green, Line[{l11, l12, l21, l22, l31, l32}]}]
, Plot[f[x], {x, 0, 16}]
]

f[x_] := x^Sin[x]in V 13.0.1 on windows and got no error. Did you try with clean kernel? I do not see why this definition would give$FailedWhat version are you using? – Nasser Mar 02 '22 at 10:00Clearvariables before using them as the function name in the definition of a new function.Clear[f]; f[x_] := x^Sin[x]will avoid potential conflicts. – LouisB Mar 02 '22 at 11:13ClearAll[x]... – janhardo Mar 02 '22 at 11:43