Let $S\subset \mathbb{R}^n$ and let $f(x)$ be a continuous function over $\mathbb{R}^n$. Furthermore, define $s_{\text{max}}:= \sup_{x\in S} \{f(x)\}$ and let $f(x)$ attain its minimum for at least one element in $S$.
Under what conditions on $f(x)$ and $S$ does it hold that $f(x_1)\leq s_{\text{max}}$ $\Rightarrow$ $x_1\in S$?
In particular, does this hold if $f(x)$ is a convex function and $S$ is a convex set? If $f(x)$ is convex and $S$ is an arbitrary set?
Unfortunately I am far from my comfort zone here, so any help is much appreciated!