The problem states that cos(3\theta) = sin(\theta)
and sin(\theta) = cos(pi/2 - \theta) as shown above, so cos(3\theta) = cos(pi/2 - \theta).
Also, another way to see that sin(\theta) = cos(pi/2 - \theta):
Draw a right triangle. There are two acute angles, call it angles A and B.
Isn't sin(angle A) = cos(angle B)?
If angle A = \theta, then angle B = 90 degrees - angle A = pi/2 - \theta
This is not a rigorous proof (only works for 0 < \theta < pi/2), but may help with intuition.