Continuous $f:(a,b)\to \mathbb{R}$ is convex iff $x \mapsto f(x)+\gamma x+\delta$ does not attain max for all $\gamma,~\delta\in \mathbb{R}$

61 Views Asked by At

Let $f:(a,b)\to \mathbb{R}$ continuous. Prove that $f$ is convex iff for all $\gamma,~\delta\in \mathbb{R}$ function $x \mapsto f(x)+\gamma x+\delta$ does not attain its maximum value on $(a,b)$.

Attempt. Straight: if for some $\gamma,~\delta\in \mathbb{R}$, convex function $f(x)+\gamma x+\delta$ attains its maximum on $(a,b)$, it would be constant (classic result), say $c$. So for all $x\in (a,b)$: $$f(x)= -\gamma x+c-\delta$$ and $f$ does not attain its maximum on $(a,b)$, contradiction.

Converse: i have seen graphically that this would be true and maybe we could work with proof by contradiction, but I haven't gotten something so far.

Thanks in advance.