Prove that $\frac{1}{2\pi i}\int_\mathcal{C} |1+z+z^2+\cdots+z^{2n}|^2~dz =2n$ where $\mathcal{C}$ is the unit circle

First of all $$ \int_{|z|=1}\overline{z}\,dz=\int_{|z|=1}\frac{dz}{z}=2\pi i, $$ since $z\overline{z}=1$. Meanwhile, for $k>1$ $$ \int_{|z|=1}\overline{z}^k\,dz=\int_{|z|=1}\frac{dz}{z^k}=0. $$

Now, when $|z|=1$, we have $\overline{z}=z^{-1}$ and hence $$ |1+z+\cdots+z^{2n}|^2=(1+z+\cdots+z^{2n})(1+\overline{z}+\cdots+\overline{z}^{2n})=\sum_{j,k=0}^{2n}z^k\overline{z}^j =\sum_{j=-4n}^{4n} c_jz^j $$ In the above sum, the term $c_{-1}$ is equal to exactly $2n$, and it is the only term which survives after the integration along the unit circle. Finally $$ \int_{|z|=1}|1+z+\cdots+z^{2n}|^2\,dz=\int_{|z|=1}\frac{c_{-1}\,dz}{z}=2\pi i c_{-1}=2\pi i\cdot 2n. $$

For $z\in\mathcal C$, we have $$|1+...+z^{2n}|^2 = (1+z+...+z^{2n})(1+z^{-1}+...+z^{-2n}) = \sum_{j=0}^{2n}\sum_{k=0}^{2n}z^jz^{-k} = \sum_{j=0}^{2n}\sum_{k=0}^{2n}z^{j-k}.$$

Therefore $$\frac{1}{2\pi i}\int_{\mathcal C}|1+z+...+z^{2n}|^2 dz = \sum_{j=0}^{2n}\sum_{k=0}^{2n}\frac{1}{2\pi i}\int_{\mathcal C}z^{j-k}dz.$$

If $j-k\neq -1$, this integral vanishes, so you just have to count the summands for which $j-k=-1$ and calculate $\frac{1}{2\pi i}\int_{\mathcal C}z^{-1}dz$.