Integral inequality using positive and negative parts

Let $f:\mathbb{R} \rightarrow \mathbb{R}$ be a measurable (with respect to the Lebesgue measure), $\pi$-periodic function which is Lebesgue integrable over $[0,\pi]$.

Moreover assume that $\int\limits_0^\pi f(x)dx = 0$. Define g(x) = \left\{ \begin{aligned} \frac{f(x)}{x} & \quad \text{for } \pi \leq x < \infty \\ \\ 0 & \quad \text{otherwise} \end{aligned} \right. .

Claim: $$\left| \int\limits_{k\pi}^{(k+1)\pi}g(x) dx \right| \leq \frac{1}{k^2\pi} \int\limits_{0}^{\pi}f^+(x)dx ,$$ where $f^+(x)$ denotes the positive part of $f(x)$.

The problem I have is that the constant $\frac{1}{k^2\pi}$ seems to be very sharp. So the basic approach \begin{align} \left| \int\limits_{k\pi}^{(k+1)\pi}g(x) dx \right| &\leq \int\limits_{k\pi}^{(k+1)\pi}\frac{\left|f(x)\right|}{x} dx = \int\limits_{k\pi}^{(k+1)\pi}\frac{f^+(x) + f^-(x)}{x} dx \\ &\leq \frac{2}{k\pi} \int\limits_{0}^{\pi}f^+(x)dx ,\end{align}

( Here we used $\int\limits_{k\pi}^{(k+1)\pi}f^+{x} dx = \int\limits_{k\pi}^{(k+1)\pi}f^-{x} dx$, whith $f^-(x)$ denoting the negative part of $f(x)$ and that $f^\pm(x)$ is $\pi$-periodic.)

seems to overestimate quite a bit.

I also tried to use the fact that $\frac{1}{x}$ is convex (Hermite-Hadamard inequality), but I couldn't come up with the constant $\frac{1}{k^2}$ and would therefore appreciate a hint, how one can find this constant.

-
What is the relation between $h$ and $f$? – marty cohen Jun 6 '13 at 16:32
I messed up h and f....ty, I corrected it. – ZornsLemming Jun 6 '13 at 16:39

It is enough to prove that $\int_{k\pi}^{(k+1)\pi} g(x)dx\leq \frac{1}{k^2\pi}\int_0^\pi f^+(x)dx$. If this is done, apply the inequality with $-f$ in place of $f$ and use the fact that $\int_0^\pi f^-=\int_0^\pi f^+$ to get the "reverse" inequality $\int_{k\pi}^{(k+1)\pi} g(x)dx\geq -\frac{1}{k^2\pi}\int_0^\pi f^+(x)dx$.
Now, to show that $\int_{k\pi}^{(k+1)\pi} g(x)dx\leq \frac{1}{k^2\pi}\int_0^\pi f^+(x)dx$ : \begin{eqnarray*} \int_{k\pi}^{(k+1)\pi} g(x)dx&=&\int_{k\pi}^{(k+1)\pi} \frac{f^+(x)-f^-(x)}x dx\\&=&\int_{k\pi}^{(k+1)\pi}\frac{f^+(x)}xdx-\int_{k\pi}^{(k+1)\pi} \frac{f^-(x)}xdx\\&\leq&\frac{1}{k\pi}\int_{k\pi}^{(k+1)\pi}f^+(x)dx-\frac{1}{(k+1)\pi}\int_{k\pi}^{(k+1)\pi} f^-(x)dx\\&=&\left(\frac{1}{k\pi}-\frac{1}{(k+1)\pi}\right)\int_{0}^{\pi} f^+(x)dx\\&=&\frac{1}{k(k+1)\pi}\int_{0}^{\pi} f^+(x)dx. \end{eqnarray*} The periodicity of $f$ plus $\int_0^\pi f^+(x)dx=\int_0^\pi f^-(x)dx$ are used at the 4th line.
So in fact one gets a slightly better inequality, with $\frac{1}{k(k+1)}$ instead of $\frac1{k^2}\cdot$