I'm trying to prove that the function $f:\mathbb{R}^2\rightarrow\mathbb{R}$, which is defined by $f(x,y)=\max\{x,y\}$, is convex.
My lecturer proved this by showing (by definition) that $f(x\cdot t +(1-t)\cdot y)\leq t \cdot f(x)+(1-t)\cdot f(y).$
I can see how the proof by definition rolls out, I've tried a different approach and would like a review on weather it is correct or not:
We know that $f(x,y)=\left\{\begin{array}{ll}x& x>y \\ y & y>x \end{array}\right.$
So I assumed it is differentiable, such that: $f_x(x,y)=\left\{\begin{array}{ll} 1& x>y \\ 0 & y>x \end{array} \right.$ and also: $f_y(x,y)= \left\{ \begin{array}{ll} 0 & x>y \\ 1 & y>x \end{array} \right. $
And therefore: $ \operatorname{Hess}f(x,y)=\begin{pmatrix} 0 & 0 \\ 0 & 0 \end{pmatrix} $, which means all of $\operatorname{Hess}f$ minors are $\geq0$, thus proving $f$ is convex.
One problem that came to mind is what happens when $x=y$, which cannot be solved by changing a finite number of points, because we're working over $\mathbb{R}^2$.
Any ideas/views on this proof are helpful in proving my understanding of this subject.
Thanks in advance!