Let $X$ be a nonempty, convex and compact subset of $\mathbb{R}$ and $f:X\rightarrow \mathbb{R}$ be a real-valued function.
Does $f$ always has a maximizer in $X$ if it is concave?
Does $f$ always has a maximizer in $X$ if it is convex?
Since $X$ is a closed and bounded set, I am very tempted to say yes in the first case, but I don't have a clue how to demonstrate it.
In the second case, I tried to give a counterexample using some function that explodes like $f(x)=x^{-1}$ and $X=[0,1]$ but I'm having problems with the extreme values (if $f(0)$ assumes any real value $f$ cease to be convex).
Could anyone help me, please?
-I had a wrong example, thx L_. for pointing it out and David M. for having a correct example-
Yes. The maximum is at one of the endpoints of the interval $X$ (as otherwise the definition of convexity applied to the endpoints is a contradiction).