you substitute the values of a and b back to the original equation, x^2 - x + 2 =0. Then you use the quadratic formula to find Im(x) = +-root(7)/2.
From here we know that beta (q^3 + q^5 + q^6) must be the case with the negative imaginary values, by the nature of the way we go around the unit circle. So, taking the imaginary values of each side we get sin(6pi/7) + sin(10pi/7) + sin(12pi/7) = -root(7)/2. Then its a simple matter to equate different sine values and get the correct answer.
Sorry Im pretty bad at explaining hope that helped