This looks like the partial fraction decomposition of a function with a double pole at each integer. The first such function that comes to mind is
$$f(x):={\pi^2\over \sin^2(\pi x)}\ .$$
In order to prove that this function is indeed the solution of your problem you may take off from the formula
$$\cot(\pi x)={1\over\pi}\left({1\over x}+\sum_{k=1}^\infty\Bigl({1\over x-k}+{1\over x+k}\Bigr)\right)\qquad(*)$$
which can be found in many textbooks. You arrive at $(*)$, e.g., by developing the function $$g(t):=\cos(x\ t)\qquad(-\pi\leq t\leq \pi)$$
for fixed $x$ into a Fourier series with respect to $t$ and put $t:=\pi$ at the end.