If we let $\cos \dfrac{\pi}{7}=x$, then we're actually asked to evaluate the expression $2x^3-x^2-x$.
[TABLE="class: grid, width: 800"]
[TR]
[TD="width: 600"]From the well-known identity $\cos \dfrac{2\pi}{7}+\cos \dfrac{4\pi}{7}+\cos \dfrac{6\pi}{7}=-\dfrac{1}{2}$,
we can rewrite it as
$\cos \dfrac{2\pi}{7}+\cos \left(\pi-\dfrac{3\pi}{7}\right)+\cos \left(\pi-\dfrac{\pi}{7}\right)=-\dfrac{1}{2}$
$\cos \dfrac{2\pi}{7}-\cos \dfrac{3\pi}{7}-\cos \dfrac{\pi}{7}=-\dfrac{1}{2}$
[/TD]
[TD="width: 200"]Note that
$\begin{align*}\cos \dfrac{2\pi}{7}&=2\cos^2 \dfrac{\pi}{7}-1\\&=2x^2-1 \end{align*}$
and $\begin{align*}\cos \dfrac{3\pi}{7}&=4\cos^3 \dfrac{\pi}{7}-3\cos \dfrac{\pi}{7}\\&=\cos \dfrac{\pi}{7}\left(4\cos^2 \dfrac{\pi}{7}-3\right)\\&=x(4x^2-3)\end{align*}$[/TD]
[/TR]
[/TABLE]
$\therefore \cos \dfrac{2\pi}{7}-\cos \dfrac{3\pi}{7}-\cos \dfrac{\pi}{7}=-\dfrac{1}{2}$ becomes $2x^2-1-x(4x^2-3)-x=-\dfrac{1}{2}$, and it's then purely algebraic work to show that $2x^3-x^2-x=-\dfrac{1}{4}$.