To elaborate on Mathlover's comment, the three numbers $\cos\frac{\pi}{7}$, $\cos\frac{3\pi}{7}$, and $\cos\frac{5\pi}{7}$ are the three roots of the monic Chebyshev polynomial of the third kind
$$\hat{V}_n(x)=\frac{\cos\left(\left(n+\frac12\right)\arccos\,x\right)}{2^n\cos\frac{\arccos\,x}{2}}=\frac1{2^n}\left(U_n(x)-U_{n-1}(x)\right)$$
where $U_n(x)=\frac{\sin((n+1)\arccos\,x)}{\sqrt{1-x^2}}$ is the usual Chebyshev polynomial of the second kind, and the last relationship is derived through the trigonometric identity
$$2\sin\frac{\theta}{2}\cos\left(\left(n+\frac12\right)\theta\right)=\sin((n+1)\theta)-\sin\,n\theta$$
The question then is essentially asking for the negative of the coefficient of the $x^2$ term of $\frac18(U_3(x)-U_2(x))$ (Vieta); we can generate the two polynomials using the definition given above, or through an appropriate recursion relation. We then have
$$\begin{align*}U_2(x)&=4x^2-1\\U_3(x)&=8x^3-4x\end{align*}$$
and we thus have
$$\hat{V}_3(x)=\frac18((8x^3-4x)-(4x^2-1))=x^3-\frac{x^2}{2}-\frac{x}{2}+\frac18$$
which yields the identities
$$\begin{align*}
\cos\frac{\pi}{7}+\cos\frac{3\pi}{7}+\cos\frac{5\pi}{7}&=\frac12\\
\cos\frac{\pi}{7}\cos\frac{3\pi}{7}+\cos\frac{3\pi}{7}\cos\frac{5\pi}{7}+\cos\frac{\pi}{7}\cos\frac{5\pi}{7}&=-\frac12\\
\cos\frac{\pi}{7}\cos\frac{3\pi}{7}\cos\frac{5\pi}{7}&=-\frac18
\end{align*}$$