Find a function such that $ \int_{-\pi}^{\pi} f(x)\sin(nx)dx = \frac{(-1)^n}{\sqrt n} $ and $ \int_{-\pi}^{\pi} f(x)\cos(nx)dx = 0 $ As the title states, I must say if the function exists or not.
I'm not sure where to begin...
Is there a general method or approach to finding this type of functions?
All I can think is that $ (-1)^n = \cos(\pi n) $ but I don't know how the $ \sqrt n $ could appear.

It tells you what the Fourier series of $f$ should be. So by the definition of the polylogarithm $\operatorname{Li}_s(z)$ and its integral representation,
$$
f(x) = \sum\limits_{n = 1}^\infty  {\frac{{( - 1)^n }}{{\sqrt n }}\sin (nx)}  = \Im \sum\limits_{n = 1}^\infty  {\frac{{( - 1)^n \mathrm{e}^{\mathrm{i}xn} }}{{\sqrt n }}}  = \Im \operatorname{Li}_{1/2} ( - \mathrm{e}^{\mathrm{i}x} )
\\
 = -\frac{1}{{\sqrt \pi  }}\Im \int_0^{ + \infty } {\frac{1}{{\sqrt t }}\frac{1}{{\mathrm{e}^{t - \mathrm{i}x}  + 1}}\mathrm{d}t}  = -\frac{\sin x}{2{\sqrt \pi  }}\int_0^{ + \infty } {\frac{1}{{\sqrt t }}\frac{{\mathrm{d}t}}{{\cosh t + \cos x}}} .
$$
This is a possible representation of a function that satisfies the requirements.
