Here's the statement: Correlation coefficient $\rho(X,Y)$ is equal to 1 (-1) $\iff$ there exist numbers $a\ne0$ and $b$ such that $P(Y=aX+b)$
The proof goes like this: Let $f(t)=E[((X-E(X))t+(Y-E(Y)))^2]=\dots =t^2var(X)+2tcov(X,Y)+var(Y)$. So $|\rho(X,Y)|=1 \iff$ the discriminant is equal to 0 ($f$ has a single root). Since $((X-E(X))t+(Y-E(Y)))^2\geq0$, $f(t)$=0 $\iff$ $P((X-E(X))t+(Y-E(Y))=0)=1$. Now we do some algebra stuff to arrange it in the desired form.
I can't understand the last iff statement: $f(t)$=0 $\iff$ $P((X-E(X))t+(Y-E(Y))=0)=1$. Why does this hold?