Convex function with convex and compact domain attains maximum I know that if convex function $f: \Omega \rightarrow R$ is continuous and $\Omega$ is compact and convex, then $f$ attains its maximum. Now what if $f$ is not continuous, will f attains its maximum as well? If so, then how to prove it (I need a formal proof or draft of a formal proof)? If not, then why?
 A: Not true. Consider the closed disk of radius $1$ in $\mathbb R^{2}$. If $f=0$ in the open disk and $f \geq 0$ on the boundary then $f$ is convex. Since the boundary values are completely arbitrary it is is obvious that it need not attain its maximum. I will let you write down a counter-example explicitly.
A: This was meant to be a comment to the A by @Kavi Rama Murphy but is too long.
In the case $\Omega=[a,b]\subset \Bbb R$ with $a<b.$


*

*Suppose $\infty>M=\sup_{x\in [a,b]}f(x)\ne \max_{x\in [a,b]}f(x).$
Let $(x_n)_n$ be a monotonic sequence in $[a,b]$ converging to $y\in [a,b]$ with $(f(x_n))_n$ converging to $M$. Now $f(y)<M$ so let $f(y)=M-3r$ with $r>0.$
Take $n_1$ with  $f(x_{n_1})>M-3r>f(y) .$ Note $x_{n_1}\ne y.$ Take $n_2$ with $|y-x_{n_2}|<|y-(y+x_{n_1})/2|$ and $f(x_{n_2})>M-r.$ Note $x_{n_2}\ne y.$ By the convexity of $f$ we have $$(i)...\quad f((y+x_{n_1})/2)\le (f(y)+f(x_{n_1}))/2\le ((M-3r)+M)/2<M-r<f(x_{n_2}).$$ $$(ii)..\quad f(y+x_{n_2})/2)\le (f(y)+f(x_{n_2}))/2<((M-3r)+M)/2<M-r<f(x_{n_2}).$$ Now $x_{n_2}$ is strictly between $A=(y+x_{n_2})/2$ and $B=(y+x_{n_1})/2$ but $f(x_{n_2})>\max (f(A),f(B)),$ contradicting the convexity of $f.$
Remark. $x_{n_2}$ is the lead actor. We could have started with $n_2$ with $f(x_{n_2})>M-r $ and with $|y-x_{n_2}|$ small enough  that there exists $z\in [a,b]$ with $x_{n_2}$ lying strictly between $y$ and $(y+z)/2,$ and replace $x_{n_1}$ with $z.$
I will leave it to the reader to show that $\sup_{x\in [a,b]}f(x)=\infty$ also leads to a contradiction.
