First, write $\displaystyle\int_{0}^{2\pi}\left(\sum_{n = 1}^{\infty}\dfrac{\cos(nx)}{2^n}\right)^2\,dx = \displaystyle\int_{0}^{2\pi}\sum_{m = 1}^{\infty}\sum_{n = 1}^{\infty}\dfrac{\cos(mx)}{2^m}\dfrac{\cos(nx)}{2^n}\,dx$.
Now, interchange the integral and the double sum to get $\displaystyle\sum_{m = 1}^{\infty}\sum_{n = 1}^{\infty}\int_{0}^{2\pi}\dfrac{\cos(mx)}{2^m}\dfrac{\cos(nx)}{2^n}\,dx$.
EDIT: Now that you have changed the question significantly, it looks like you are trying to find the Fourier series coefficients for $f(x)^2$ where $f(x) = \displaystyle\sum_{n = 1}^{\infty}\dfrac{\cos(nx)}{2^n}$. If this is indeed the case, since you already have the Fourier series coefficeints for $f(x)$, I would recommend using the fact that multiplication in the time domain corresponds to convolution in the frequency domain.
Specifically, if we know that $f(x) = \displaystyle\sum_{n = -\infty}^{\infty}a_ne^{inx}$ and $g(x) = \displaystyle\sum_{n = -\infty}^{\infty}b_ne^{inx}$, then $f(x)g(x) = \displaystyle\sum_{n = -\infty}^{\infty}c_ne^{inx}$ where $c_n = \displaystyle\sum_{k = -\infty}^{\infty}a_kb_{n-k}$.