The series $$\sum_{n=1}^\infty \frac{\sin nx}{n}$$ is the Fourier series of the odd $2\pi$-periodic extension of $(\pi-x)/2, 0<x<\pi$.
My question is : $$\sum_{n=1}^\infty \frac{\cos nx}{n}$$ is the Fourier series of the even $2\pi$-periodic extension of what function?

The function $-\frac{1}{2}\ln(2-2\cos x)$ simplifies to $f(x)=-\ln(2\sin(x/2))$. We will show that the Fourier cosine series of $f(x), 0<x<\pi,$ is $$\sum_{n=1}^\infty \frac{\cos nx}{n}.$$ Firstly, $$\frac{1}{\pi}\int_0^\pi f(x)\,dx=\frac{1}{\pi}\int_0^\pi \ln 2+\ln(\sin(x/2))\,dx=0$$ because $$\int_0^\pi \ln(\sin(x/2)\,dx=2\int_0^{\pi/2}\ln(\sin(u))\,du=\int_0^\pi \ln(\sin(u))\,du=-\pi\ln 2$$ where the last equality can be found in Ahlfors' Complex Analysis p. 159. Let $n\ge 1$ be an integer. Using integration by parts with $u=\ln(\sin(x/2)$ and $dv=\cos(nx)\,dx$, and the fact that $\lim_{x\to 0^+}\sin(nx)\ln(\sin(x/2)=0$, we get (note that $\int_0^\pi \ln2\cos(nx)\,dx=0$) $$\int_0^\pi f(x)\cos nx\,dx=\frac{1}{2n}\int_0^\pi \cot(x/2)\sin nx\,dx=\frac{\pi}{2n}$$ where the last equality is from here. This proves that $$\frac{2}{\pi}\int_0^\pi f(x)\cos nx\,dx=\frac{1}{n}.$$
Note that the even $2\pi$-periodic extension of $-\ln(2\sin(x/2)), 0<x<\pi$ is the $2\pi$-periodic function $$-\ln\left|2\sin\left(\frac{x}{2}\right)\right|=\ln\left| \frac{1}{2}\csc\left(\frac{x}{2}\right)\right|,$$ $-\infty<x<\infty$.