Can there be such a function:
$f \colon \mathbb R \to \mathbb R$ is continuous and non-constant. It has a local maxima everywhere, i.e., for all $x \in \mathbb R$ there is some $\delta_x>0$ such that $f(x)\geq f(y)$ for all $y \in B(x,\delta_x)$. And, yet $f$ has no global maxima?
Thank you.
PS: $\mathbb R$ is with the usual topology. This is true for $\mathbb R$ with upper-limit topology.
No such function exists. If $f$ is continuous and has a local maximum everywhere, then $f$ is constant. To see this, let $a$ be a real number. By continuity, $\{x:f(x)\leq f(a)\}$ is closed, and by the hypothesis on local maxima, $\{x:f(x)\leq f(a)\}$ is open. The set is nonempty because it contains $a$, so it is all of $\mathbb{R}$ by connectedness. Therefore, for all $a$ and $b$ in $\mathbb{R}$, $f(b)\leq f(a)$ and similarly $f(a)\leq f(b)$.