Let's say that a function $f: \mathbb{R} \to \mathbb{R}$ obtains a local maximum at the point $(x_0,y_0)$, and this is the only local maximum. Are we able to say that this point is a global maximum by virtue of the fact that it is the only maximum? Is it possible that the function may not have a global maximum?
I'm getting the sense that the answer is no when regarded as a function from $\mathbb{R} \to \mathbb{R}$, but if it's restricted to a closed interval, the answer is yes. I'm not certain, however.
For $\varphi:\mathbb{R}\to \mathbb{R}$ the function $\varphi(x)= x^3-3x$ has the only local maximum at $x=-1$ and $\varphi(-1)=2.$ Clearly it is not a global maximum as the function is unbounded from above. Similar effect occurs for any open interval. For example the function $f:(-\pi/2,\pi/2)\to \mathbb{R},$ $f(t)=\varphi(\tan t)$ admits the only local maximum at $t=-\pi/4.$
Concerning $f:[a,b]\to \mathbb{R},$ any continuous function admits a global maximum due to the Weierstrass theorem. But if we give up the continuity we can take $$\psi(x)=\begin{cases} x^3-3x & -2\le x<3\\ 0 &\quad\quad\ \ x=3\end{cases}$$ The function has local maximum at $x=-1$ but there is no global maximum.