What are the functions $f:\mathbb R\to\mathbb R$ such that every point is a local maximum?
Certainly, $f(x)=c$ works for every constant. So does $\lfloor x\rfloor$, as does $I_{\{0\}}(x)=\begin{cases}1&x=0\\0&x\ne0\end{cases}$. Another example is the oddly beautiful $e^{-\lfloor1/\lvert x\rvert\rfloor^{-2}}$. Question is, are step functions such as these the only ones? Are there any examples where every point is a strict local maximum?
(Thomae's function is a near-miss, since the condition doesn't hold on irrational points. Although, most points are irrational, so I guess the term "near-miss" doesn't quite fit.)
EDIT: My definition of step-function is the sum of countably many indicator functions of intervals, $\sum_{n=0}^\infty a_nI_{A_n}(x)$. If it were uncountable, any function would be step, as $\{\alpha\}$ is an interval ($[\alpha,\alpha]$).
This arose when I was thinking about the topological space with basis $\{(-\infty,a]:a\in\mathbb R\}$. If you call that space $X$, then the continuous functions $f:\mathbb R\to X$ are precisely these. I don't have a formal proof but I'm pretty sure (and this would belong in a different question anyway).
Contrast with: Is $f$ constant if every point is local maximum or local minimum of $f$?