Answer :
Recall the identity,
[tex]\cos\theta+\cos3\theta+\cos5\theta+\cos7\theta=\dfrac{\sin8\theta}{2\sin\theta}[/tex]
(link to proof in the comments)
so that the required sum has a value of
[tex]\cos\dfrac\pi9+\cos\dfrac{3\pi}9+\cos\dfrac{5\pi}9+\cos\dfrac{7\pi}9=\dfrac{\sin\frac{8\pi}9}{2\sin\frac\pi9}[/tex]
Recall another identity,
[tex]\sin(\pi-x)=\sin x[/tex]
which means
[tex]\sin\dfrac{8\pi}9=\sin\left(\pi-\dfrac\pi9\right)=\sin\dfrac\pi9[/tex]
Then the sum's value reduces to 1/2.