Suppose that $$\sum_{n \in \mathbb{Z}-\{0\}} n^{-1}e^{inx}$$ is the Fourier series of some function $g(x) \in L^{2}[-\pi, \pi]$. Find a closed form for $g(x)$.
I have been stuck on this all day. My only two observations that seemed might be useful were that we must have $$ \hat{g}(n) = \frac{1}{2\pi}\int_{-\pi}^{\pi}g(x) \, e^{ikx} dx = \frac{1}{2\pi}\int_{-\pi}^{\pi}g(x) \, \cos(nx) dx + \frac{i}{2\pi}\int_{-\pi}^{\pi}g(x) \, \sin(nx) dx = n^{-1} $$
for all $n \in \mathbb{Z}, n \neq 0$ and the observation that the original Fourier series, under the substitution $z = e^{ix}$ is basically the power series for $\ln(1-x)$. I can't seem to get anywhere on this, I also can't seem to see why it matters that $g \in L^{2}$ other than the fact that it means I don't have to find a continuous function. I tried exploring both observations at length and never got anything.