Suppose $f:\mathbb{R}^n\to \mathbb{R}$ is both convex and concave, how to prove that $f$ is linear? or exactly speaking, $f$ is affine?
I thought for the whole day, but I cannot figure it out.
When I was working on this problem, I met another problem, are all the convex function continuous? If not, is there any counter example?
Actually, I can prove for one dimensional case, in which $f:\mathbb{R}\to \mathbb{R}$. However, I cannot generalize it into n dimensional cases.
By the way, I use definition for convex(concave) like this: $$f(t\vec{x}+(1-t)\vec{y})\leq(or \geq) tf(\vec{x})+(1-t)f(\vec{y}), \forall t\in[0,1].$$
Thank you so much!