How to prove for any real-valued function , it assumes at least one local maximum and at least one local minimum on any , ?
You can't, it's not true. For example, if for x not equal to 0 or 1, f(0)= f(1)= 0, then f does NOT assume maximum or minimum values on [0, 1].
What is true is that any continuous function assumes a maximum and minimum on a closed and bounded interval.
The standard proof is a very complicated and involves showing that a continuous function maps a closed and bounded interval into a closed and bounded interval.
Once you assume continuity it's true, as HalsofIvy pointed out. Have you seen compactness yet? That's the best way to think about it, if you're allowed to use it.