Solution (source code)

= Solution

Put $U=X-EX$ and $V=Y-EY$. Their second moments are the finite positive <variances> of $X,Y$. The <Cauchy-Schwarz inequality> for square-integrable <random variables> gives
$$
|E(UV)|^2\leq E(U^2)E(V^2)=\operatorname{Var}X\,\operatorname{Var}Y.
$$
Divide by the positive product of <variances> and take square roots. \b[The correlation bound is $\boxed{-1\leq\rho(X,Y)\leq1}$.] As usual, non-constant here means not almost surely constant, so that the denominator is nonzero.