Look at this page and the Proof part,
Fermat's theorem (stationary points) - Wikipedia, the free encyclopedia
How to change the proof 2 into a proof of higher dimensions or can you give a proof of Fermat's theorem of higher dimensions?
To clarify, I need to prove this:
Let and be a continuous function. Prove that if is a local maximum point for , then either is differentiable at with or is not differentiable at .