The first part is relatively simple. If we write tan(3x) as tan(2x+x) we can use addition formulae to give:
tan(2x+x)= (tan(2x)+tan(x))/(1-tan(2x)tan(x))
tan(2x) = 2tan(x)/(1-tan^2(x))
Substituing this in and multiplying top and bottom by (1-tan^2(x)) gives:
tan(3x) = (3tan(x)-tan^3(x))/(1-3tan^2(x))
The next part is more tricky. If we write tan(x) = t it becomes more obvious how the first part relates to the second. If we set tan(3x) to 1 we can see that this gives the equation above. tan(pi/4) = 1 and so does tan(5pi/4) and tan(9pi/4). 3x = pi/4 gives x = pi/12, 3x = 5pi/4 gives x = 5pi/12 and 3x = 9pi/4 gives x= 3pi/4.
This gives t = tan(pi/12), tan(5pi/12) and tan(3pi/4) (which is -1)
[Note: The more astute will notice that tan(3x) = 1 has an infinite number of solutions, not just pi/12, 5pi/12 and 9pi/12. In fact x = pi/12 +npi/3 (where n is any integer). However, tan(pi/12 + npi/3) only ever goes between three values for all values of n since tan is periodic with period pi.]