If $f:\mathbb{R}\to\mathbb{R}$ then it's a fact that we can only have countable local extreme values, so if the function is continuous and every point takes a local extreme value (could be a local maximum or local minimum value ) , we know f must be constant. 

My question is: if we drop the condition continuous, can we prove there must be a interval that f is constant on it?