Let and be a continuous function. Prove that if is a local maximum point for , then either is differentiable at and or is not differentiable at . Deduce that if is differentiable on , then a global maximum point of f is either a critical point of f or an element of .

It's a little bit about optimization but stil analysis. Well I have no idea about this question and I think I need a proof. Thank you!