# How to prove covariance inequality?

Problem statement - Let $$X$$ be any random variable and $$g(x)$$ and $$h(x)$$ be any functions such that $$E(g(X)), E(h(X))$$ and $$E(g(X)h(X))$$ exist. If $$g(x)$$ is non-decreasing and $$h(x)$$ is non-increasing then prove that $$E(g(X)h(X)) \le E(g(X))E(h(X))$$.

I started from $$E(g(X)h(X)) = \int_{-\infty}^\infty g(x)h(x)f(x) dx$$

I have absolutely no idea how to proceed from here. I know that I need to use the fact that $$g(x)$$ is non-decreasing and $$h(x)$$ is non-increasing but don't know how to do it. Please tell me how to proceed.

Let $$Y$$ be another random variable such rthat $$X$$ and $$Y$$ are independent and $$Y$$ has same distribution as $$X$$. If $$X \geq Y$$ then $$(g(X)-g(Y))(h(Y)-h(X)) \geq 0$$ (because both factors are non-negative). Check that the same inequality holds if $$X \leq Y$$. Hence $$(g(X)-g(Y))(h(Y)-h(X)) \geq 0$$ always and $$E(g(X)-g(Y))(h(Y)-h(X)) \geq 0$$. Expand this product and use the fact that $$\{X,Y\}$$ is i.i.d to complete the proof.