We use the basic fact that a function continuous on a closed interval attains an absolute maximum and an absolute minimum in that interval.
We show that under our conditions there is a point $c$ in the open interval $(x_1,x_2)$ at which our function (which I will call $f$) attains an absolute minimum, and therefore a local minimum.
There is only one slightly tricky point on which one could stumble: it is possible that $f$ attains its absolute minimum at one of $x_1$ or $x_2$. The two cases are dealt with similarly.
So suppose that $f$ attains an absolute minimum for the interval $[x_1,x_2]$ at $x_1$. Because we have a local maximum at $x_1$, there is a interval $[x_1,x_1+\epsilon)$ such that $f(x_1)\ge f(x)$ for all $x$ in $[x_1,x_1+\epsilon)$. But because at $x_1$ we have an absolute minimum for the interval $[x_1,x_2]$, we also have $f(x_1)\le f(x)$ for all $x$ in the interval $[x_1,x_1+\epsilon)$.
It follows that $f(x)=f(x_1)$ for all $x$ in $[x_1,x_1+\epsilon)$. Thus $f$ attains a local minimum at, for example, $x_1+\epsilon/2$.