If we define a continuous non-constant function $f:A\to [0,\infty)$ where $A\subset \mathbb{R^n}$ and is closed but not bounded, and if we also have that $\lim_{x\to \infty} f(x)=0$ then can we prove that $f$ has a max on $A$?
I know the extreme value theorem gives us that a continuous function attains a max provided the set it maps from is compact, but given the lack of boundeness of set $A$ i'm unsure of how to proceed.
If the function is non-constant, then there must exist some $x_0\in A$ such that $f(x_0)\neq 0.$ Since $\lim_{|x|\to\infty}f(x)=0$, there exists $M$ such that for all $x$ with $|x|>M$ we have $f(x)<f(x_0)/2$. Let $B=\{x\in \mathbb R^n: |x|\leq M\}$. Then $A\cap B$ is compact because it is closed and bounded, and it is nonempty because it contains $x_0$. Therefore, $f$ achieves a maximum on $A\cap B$, and that maximum is bigger than or equal to $f(x_0)$, so it is bigger than $f(x)$ for all $x$ outside of $A\cap B$, i.e., those $x$ with $|x|>M$.