Can anyone help me to construct an example of two continuous random variables X and Y whose covariance is positive, but there exist two non-decreasing functions f and g, such that the covariance of f(X) and g(Y) is negative?

I have trouble constructing bivariate joint pdf in general. How can I make sure that the joint pdf of X and Y integrates to 1, while at the same time the marginal pdf's of X and Y both integrate to 1?