Let f(x) = {1 + sin x, x < 0x2 − x + 1, x ≥ 0. Then
f is continuous at ‘0’ and f' (0-) > 0 and f' ( 0 +) < 0 . Thus f has a local maximum at ‘0’.