I'm having some difficulties with the following proof:
Only onder special circumstances it can be the case that $\rho(X,Y)^1=\pm1$, and these circumstances are explored by considering the proof of the Cauchy-Schwartz inequality more carefully. Let $a=\operatorname{var}(X)$, $b=2\operatorname{cov}(X,Y)$, $c=\operatorname{var}(Y)$ and suppose that $\rho(X,Y)=\pm1$. Then $\operatorname{var}(X)\operatorname{var}(Y)\neq0$ and $$b^2-4ac=4\operatorname{var}(X)\operatorname{var}(Y)\big[\rho(X,Y)^2-1\big]=0,$$ and so the quadratic equation $$as^2+bs+c=0$$ has two equal real roots, at $s=\alpha$, say. Therefore, ...
I find the proof overall a bit weird, because I don't know how they came up with it. But I can follow the algebraic steps and such, so in essence I'm ok with the proof.
It continues as follows:
Therefore, $W=\alpha[X-\mathbb E(X)]+[Y-\mathbb E(Y)]$ satisfies $$ \mathbb E(W^2)=a\alpha^2+b\alpha+c=0, $$ giving that $\mathbb P(W=0)=1$, and showing that (essentially) $Y=-\alpha X+\beta$, where $\beta=\alpha\mathbb E(X)+\mathbb E(Y)$. A slightly more careful treatment discriminates between the values $+1$ and $-1$ for $\rho(X,Y)$: $$ \begin{aligned} \rho(X,Y)&=1\quad\text{if and only if }\mathbb P(Y=\alpha X+\beta)=1\text{ for some real }\alpha\text{ and }\beta\text{ with }\alpha>0\\ \rho(X,Y)&=-1\quad\text{if and only if }\mathbb P(Y=\alpha X+\beta)=1\text{ for some real }\alpha\text{ and }\beta\text{ with }\alpha<0.\\ \end{aligned} $$
\begin{align*} \rho(X,Y)&=1&& \begin{aligned}[t] \text{if and only if }\mathbb P(Y=\alpha X+\beta)=1\\ \text{for some real $\alpha$ and $\beta$ with }\alpha>0, \end{aligned}\\ \rho(X,Y)&=-1&& \begin{aligned}[t] \text{if and only if }\mathbb P(Y=\alpha X+\beta)=1\\ \text{for some real $\alpha$ and $\beta$ with }\alpha<0. \end{aligned}[t] \end{align*}
So, I can follow everything, except for the last bit where they are giving the conditions for $\rho(X,Y)=1$ and $\rho(X,Y)=-1$.
Say we look at $\rho(X,Y)=1$. It follows that $\operatorname{cov}(X,Y)=\sqrt{\operatorname{var}(X)\operatorname{var}(Y)}$. What else can I use to show that these are indeed the conditions?