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.
Two facts: (a) Differentiation of a function multiplies its Fourier coefficients by $in$, and integration divides them by $in$;
(b) The Dirac Delta function at 0, denoted $\delta_0$, has all Fourier coefficients equal to $1/(2\pi)$ because $$ c_n = \frac{1}{2\pi}\int_{-\pi}^\pi \delta_0(x) e^{-i n x}\,dx = \frac{1}{2\pi} $$ for all $n$.
Combining these, we see that we need to adjust Dirac Delta so that its 0th coefficient is 0, and then integrate it. The adjusted form is $2\pi \delta_0 - 1$; this has Fourier coefficients $$ c_n = \begin{cases} 1, \quad n\ne 0 \\ 0, \quad n=0\end{cases} $$ Integration results in a function that jumps up by $2\pi$ at $0$, and is decreasing with slope $-1$ the rest of the way. Such a function can be written as $$ f(x) = \begin{cases} \pi-x, \quad &0<x<\pi \\ -\pi-x, \quad & -\pi < x < 0\end{cases} $$ Now you can ignore the argument about Dirac Delta, and just check that this $f$ has Fourier coefficients $$ c_n = \frac{1}{2\pi}\int_{-\pi}^\pi f(x) e^{-i n x}\,dx = \frac{i}{n} $$ for all $n$, except $c_0=0$.
Conclusion: the function you want, with coefficients $n^{-1}$, is $-i f$.