Covariance from a monotone function of a random variable How to prove that if $f,g$ monotonically increase, then $\text{Cov}(f(X),g (X))>0$, using that $(f(a)-f(b))(g(a)-g(b))>0$.
 A: Without loss of generality, we may assume that $\mathbb{E}[f(X)] = \mathbb{E}[g(X)] = 0$. This amount to subtracting constants from $f$ and $g$, which doesn't affect the covariance. 
So, 
$$ \mathrm{cov}(f,g) = \mathbb{E}[fg].$$ 
Firstly, if $fg > 0$ everywhere then we're done. Let us assume this is not the case, so that there is at least one value of $b$ such that $f(b)g(b) \le 0.$ Now, notice that $$ \mathrm{cov}(f,g) = \mathbb{E}[fg] = \mathbb{E}[( f - f(b)) g] = \mathbb{E}[(f-f(b))(g-g(b))] - f(b)g(b).$$
The first of these terms is strictly positive, since $(f(X) - f(b))(g(X) - g(b)) > 0$ everywhere. Further, $-f(b)g(b) \ge 0$ by design. We conclude that $\mathrm{cov}(f,g) > 0$ in this case as well.

An alternate which I like - It is relatively straightforward to argue that for increasing $h$, $\mathrm{cov}(h(X), X) > 0$. Now, let $Y = g(X).$ Then $\mathrm{cov}(h (Y),Y) = \mathrm{cov}(h \circ g(X), g(X))$ by change of variables. If we can find an increasing $h$ such that $h\circ g = f,$ then we're done. But this exists - since $g$ is increasing, it has an inverse that is also increasing. Then $f \circ g^{-1}$ is also increasing, and this can serve as our $h$. 
The first proof above is easier to generalise to non-decreasing functions, though, because we don't need to muck about with left/right inverses.
