I know that if $X = a Y + b$ and $a>0$ then $\operatorname{Corr}=1$. it can be proved easily using the fact that $Cov(X,Y) = E(XY)-E(X)E(Y)$ and $\sigma^2_X =Var(X) = a^2 Var(Y) = a^2 \sigma^2_Y$ and $E(X) = a E(Y) + b$, and substituting $X = a Y + b$ in the covariance formula, and also the definition of correlation that $\operatorname{Corr}(X,Y) = \frac{\operatorname{Cov}(X,Y)}{\sigma_X \sigma_Y}$
But as I know, it is an "if and only if" relation (biconditional) and so we have that if $\operatorname{Corr}(X,Y) =1$ then $X = a Y + b$ with $a>0$. I can understand this intuitively but I don't know how to rigorously prove this.