Prove convexity of split function (linear and quadratic)

Prove that $$f(x)=\begin{cases} \frac{2}{3}x^2+\frac{2}{3}x-\frac{1}{12} &\quad x<-0.5 \\ -0.25 &\quad x\geq -0.5 \\ \end{cases}$$ is convex over $$\mathbb{R}$$.

As far as I understand I cannot use second derivative because the function is non-differentiable (at $$x=-0.5$$).

If both $$x,y \geq0.25$$ or $$x,y < 0.25$$ this is easy (both cases are convex). But I couldn't find an algebric approach to prove the case where $$x<-0.5$$ and $$y \geq -0.5$$.

Thank you.

• The function is differentiable, and its derivative is non-decreasing, which should be enough for convexity.
– dxiv
Jun 1 at 7:47
• @dxiv You are absolutely right, didn't notice. Thank you. Jun 1 at 12:01

I didn't notice that the function $$f(x)$$ actually is differentiable. $$f'(x)=\begin{cases} \frac{4}{3}x+\frac{2}{3} &\quad x<-0.5 \\ 0 &\quad x\geq -0.5 \\ \end{cases} \quad f''(x)=\begin{cases} 4/3 &\quad x<-0.5 \\ 0 &\quad x\geq -0.5 \\ \end{cases}$$
One can see that $$f'_+(-0.5)=0=f'_-(-0.5)$$ (left and right derivatives are equal), so $$f$$ is continuously differentiable over $$\mathbb{R}$$.