On the exam I suspect we both took, I solved this the following way (I suspect this answer will be useful since we never learned to employ fourier series in our class the way the other answers presciently suggest):
Suppose we can separate variables; $u(x,t) = X(x)T(t).$ Then the equation reads
$$X(x)T'(t) = X''(x)T(t) + X'(x)T(t).$$
Divide by the solution (if you're uncomfortable with this, look up "separation of variables divide by zero" to find the relevant explanation on this website) to find
$$\frac{T'(t)}{T(t)} = \frac{X''(x) + X'(x)}{X(x)}.$$
Realize that each side of the equation above is constant; call this constant $\chi.$ Solve the equation
$$0 = X''(x) + X'(x) - \chi X(x)$$
by the means familiar to you from Math 27300. I.e., commit yourself to the ansatz $X(x) = \mathrm{Re}(A_n\mathrm{e}^{i \omega_n x})$ and write down the characteristic polynomial
$$-\omega_n^2 + \mathrm{i} \omega_n - \chi = 0$$
Then also impose the condition that
$$X(x) = X(x+1),$$
which mandates that $\omega_n = 2\pi n$ for $n \in \mathbf{N}.$
Solve for $\chi$ in the characteristic polynomial; then going back to our variable-separated differential equation for $T$ we can write
$$T'(t) = \chi T(t) = (-4\pi^2 n^2 + \mathrm{i} (2\pi n))T(t).$$
You have again the opportunity to make your Basic Theory of Ordinary Differential Equations instructor proud by employing the ansatz
$$T(t) = \mathrm{Re}\left[ B_n \, \mathrm{e}^{(-4\pi^2 n^2 + 2\pi \mathrm{i} n )t}\right]$$
but you would be justifiably chastised if you were not to notice that the solution to the original PDE will hence be obtained by the Ansatz
$$u(t,x) = \mathrm{Re}\left[ \sum_{n \in \mathbb{N}} \mathrm{e}^{(-4\pi^2 n^2 + 2\pi \mathrm{i} n )t} (a_n \cos(2 \pi x) + \mathrm{i}\, b_n \sin (2\pi x))\right]$$
since you realize that the second-order ODE for $X$ requires two undetermined constants per $\omega_n$ and you must take real parts at the end of the calculation for a linear combination of complex ansätze which each satisfy the original PDE.
Now simply apply the initial condition. It's easier if we notice
$$u(0,x)=\cos(2\pi x) = \mathrm{Re}[\mathrm{e}^{2\pi x}]$$
so we can use our knowledge of orthogonal functions to realize
$$a_n = b_n = 1 \, \, \mathrm{for} \, \, n = 1$$
and $0$ otherwise. Then
\begin{align*}
u(t,x) &= \mathrm{Re}\left[\mathrm{e}^{(-4\pi^2 + 2\pi \mathrm{i})t}(\cos{2\pi x} + \mathrm{i}\sin{2 \pi x})\right] \\
&= \mathrm{e}^{-4\pi^2 t}[\cos(2\pi t)\cos(2 \pi x) - \sin(2 \pi t) \sin (2 \pi x)].
\end{align*}