Let \(X\) be a random variable with values in an interval \(I\), and suppose that \(f\) and \(g\) are nondecreasing functions on \(I\) such that \(f(X)\) and \(g(X)\) have finite variance. Show that \(\operatorname {Cov}(f(X),g(X))\geq 0\).
Hint: If \(X_1\) and \(X_2\) are i.i.d. as \(X\), then \((f(X_1)-f(X_2))(g(X_1)-g(X_2))\geq 0\).