Alright, I don't like this question because the thing with the months starting on the 1st of January makes it unclear (to me) whether January is the 0th month or the 1st month of the model. The book's answers rely on the latter, but to me 1 month after the 1st of January is the 1st of February. With that aside, and taking the book's perspective of the months starting with January=1, the question is still doable.
Because it's a cos graph we can figure out the period with the rule p=2pi/b where b is the coefficient of the independent variable (m) which is pi/6 in this case.
2pi/(pi/6)=12 which is nice because a year has 12 months so we get an easy number to work with.
This also means that the results for 2008 are going to be exactly the same as when dealing with 2007, because a trig graph repeats exactly with every period.
Now, there are two ways to approach this- one of them is graphical and the other is algebraic.
THE GRAPHICAL APPROACH
consider the graph of this function. with no horizontal translations, it will be a basic cosine graph with an amplitude of 7, a period of 12 and a mean value of 18 (translated 18 units up)
if we consider only 1 period of this graph (one year) we see that it is symmetrical.
if sketching it, you may like to label the horizontal axis with the months, but this is not that necessary.
the question asks us for the time between February and the next time that the town has the same temperature.
since the graph is symmetrical, and since February is at m=2, we can just find the point that is 2 units away from the other side of the graph
(I have attached a very average paint drawing that illustrates this)
this Month is 10, October, 8 months after 2, February
THE ALGEBRAIC APPROACH
this is a little faster and doesn't require a graph, but is a little harder to visualize.
think of your unit circle definition for cosine. As m increases, the angle inside the cos function is going to increase.
the value that was inside the function when m=2 (Feb) is pi/6 *2 =pi/3
the only other angle within the unit circle that will give you the same value when you put it into the cos function (and therefore the same temperature as in february) is 5pi/3 (300 degrees, 60 degrees short of a full circle)
THEREFORE, when the inside of the function = 5pi/3, you will get the same temperature.
we can use this to find what m must be for the temperature to be the same
pi/6 * m must equal 5pi/3
pi*m/6 = 5*pi/3
divide both sides by pi to get rid of that
m/6=5/3
times both sides by 6
m=10
THEREFORE when m=10, T is going to equal the same as when m was 2 (Feb)
10-2=8
therefore 8 months pass before the temperature repeats