This is a fact that is geometrically evident but a pain to prove.
Note that the overlap is essential, if $f(x) = -|x|$, then on the intervals
$[-1,0]$ and $[0,1]$ the function
$f$ is linear hence convex, but clearly $f$ is not convex on $[-1,1]$.
Define
$R(x,y) = {f(x)-f(y) \over x-y}$ for $x \neq y$. Note that $R$ is symmetric.
Then $f$ is convex iff $x \mapsto R(x,y)$ is monotonically non decreasing for each $y$. (cf. the derivative characterisation of convexity.)
We need to show that for all $t \in [0,1]$ that $f((t-1)x+ty) \le (t-1)f(x)+t f(y)$.
Suppose $x<y$. If $y \in [a,c]$ or $x \in [b,d]$ there is nothing to show, so
suppose $x \in [a,b), y\in (c,d]$.
Choose $m,m'$ such that $b<m'<m<c$. Then
$R(m,x) \le R(m,m') \le R(y,m') \le R(y,m)$. This is where the overlap is used.
Note that
\begin{eqnarray}
R(y,x) &=& {1 \over y-x} [R(m,x)(m-x) + R(y,m)(y-m)] \\
&\ge& {1 \over y-x} [R(m,x)(m-x) + R(m,x)(y-m)] \\
&\ge& R(m,x)
\end{eqnarray}
A similar analysis shows that $R(y,x) \le R(y,m)$.
Let $t^* = {m-x \over y-x}$. First suppose $t \le t^*$ and let $\lambda={t \over t^*}$.
Note that $x+\lambda(m-x) = x+t (y-x)$.
Then
\begin{eqnarray}
f(x+t(y-x)) &=& f(x+ \lambda(m-x)) \\
&\le& f(x)+ \lambda (f(m)-f(x)) \\
&=& f(x)+ t ( {y-x \over m-x} ) ( f(m)-f(x)) \\
&=& f(x) + t (y-x) R(m,x) \\
&\le& f(x) + t (y-x) R(y,x) \\
&=& f(x) + t (f(y)-f(x))
\end{eqnarray}
Now suppose $t \ge t^*$ and let $\mu = {t-t^* \over 1-t^*}$. Note that
$y+(1-\mu) (m-y) = x+t(y-x)$. Then
\begin{eqnarray}
f(x+t(y-x)) &=& fy+(1-\mu) (m-y)) \\
&\le& f(y)+ (1-\mu)(f(m)-f(y)) \\
&=& f(y)+ (1-t)( {y-x \over y-m} ) (f(m)-f(y)) \\
&=& f(y) + (1-t)(y-x) (-R(y,m)) \\
&\le& f(y) + (1-t)(y-x) (-R(y,x)) \\
&=& f(y) + (1-t) (f(x)-f(y)) \\
&=& f(x) + t (f(y)-f(x))
\end{eqnarray}