Consider first the functions $$h_1(x)=\frac{|\pi-x|}{2},\,\,h_2(x)=-2\ln\left|\sin\frac{x}{2}\right|.$$ It is shown here that the Fourier series of $h_1$ on $(-\pi,\pi)$ is $\sum_{j=1}^{\infty}\frac{\sin jx}{j}$, and the Fourier series for $h_2$ on $(-\pi,\pi)$ is $\sum_{j=1}^{\infty}\frac{\cos jx}{j}$. Therefore, the Fourier series of the function $\sin x\cdot h_1+\cos x\cdot h_2$ is equal to $$\sum_{j=1}^{\infty}\frac{\cos x\cos jx+\sin x\sin jx}{j}=\sum_{j=1}^{\infty}\frac{\cos(j-1)x}{j}=1+\sum_{j=1}^{\infty}\frac{\cos jx}{j+1}.$$ This shows that $$\sum_{j=1}^{\infty}\frac{\cos jx}{j+1}\xrightarrow[j\to\infty]{}\cos x\cdot h_1(x)+\sin x\cdot h_2(x)-1=g(x)$$ in $L^2(-\pi,\pi)$.
Let now $c\in L^2(\mathbb Z)$ be a sequence that satisfies the given relation, and set $f\in L^2(-\pi,\pi)$ to be the $L^2$-limit of $$f_n(x)=\sum_{k=-n}^nc_ke^{ikx}.$$ Note then that $$c_k=\frac{1}{2\pi}\int_{-\pi}^{\pi}f(x)e^{-ikx}\,dx.$$ We also compute $$c(k+j)+c(k-j)=\frac{1}{2\pi}\int_{-\pi}^{\pi}f(x)\left(e^{-i(k+j)x}+e^{-i(k-j)x}\right)\,dx
\\=\frac{1}{2\pi}\int_{-\pi}^{\pi}2f(x)\cos jx\cdot e^{-ikx}\,dx,$$ therefore the given relation shows that, for any $k\in\mathbb Z$,
$$\int_{-\pi}^{\pi}f(x)e^{-ikx}\,dx=\sum_{j=1}^{\infty}\int_{-\pi}^{\pi}2 f(x)\frac{\cos jx}{j+1}e^{-ikx}\,dx=\int_{-\pi}^{\pi}2f(x)g(x)e^{-ikx}.$$ This shows that all the Fourier coefficients of $f$ and $2fg$ are equal, therefore $f=2fg$ almost everywhere. But, there are finitely many solutions of the equation $2g=1$ in $(-\pi,\pi)$, therefore $f$ has to be zero almost everywhere. This shows that $c$ should be identically zero.