Can someone please help me break down the proof below from $(*)$ onwards. I'm lost at what is going on and where the proceeding steps are coming from. Is this a proof by contradiction? Why are we assuming $M^2\lt 2 , M^2\gt 2$, and choosing $\delta$ to be the minimum of $\frac{2-M^2}{5}$ and $1$?
Theorem 2.13 (Square root 2 exists). There exists $x\in\mathbb{R}$ with $x^2=2.$
Proof.
Define $$A=\{y\in\mathbb{R}|y^2 \leq{2}\}.$$
As $0^2\leq{2}$, we have $0\in{A}$, so $A$ is non-empty. Now suppose $y\in\mathbb{R}$ has $y\geq{2}$, then $y^2\geq{4}$, so $y\notin{A}$. Thus, $2$ is an upper bound for A and hence A is bounded above. Therefore, by the completeness axiom, $M=\sup(A)$ exists. Note that $M\geq{1}$ as $1\in{A}$ and $M\leq{2}$ is an upper bound for A.
$(*)$
Suppose $M^2\lt{2}$. Choose $\delta\gt{0}$ with $\delta\lt $ min$(\frac{2-M^2}{5},1)$, and then define $ y=M+\delta$. As $\delta\lt{1}$, we have $\delta^2 \lt{\delta}$ and so
$$y^2=(M+\delta)^2=M^2+2M\delta+\delta^2\leq M^2+4\delta+\delta=M^2+5\delta\lt 2.$$
Thus $y\in A$, but this is a contradiction as $y\gt M$. Therefore $M^2\geq 2$.
Suppose $M^2\gt 2$. Choose $\delta \gt 0$ with $\delta\lt $min$(M,\frac{M^2-2}{2M})$ so that $M^2-2M\delta \gt 2$ and $M-\delta\gt 0$. Then,
$$(M-\delta)^2=M^2-2M\delta+\delta^2\geq M^2-2M\delta\gt 2.$$
Now if $y\geq (M-\delta)$, then $y^2\geq (M-\delta)^2 \gt 2$ so $y\notin A$. Thus $M-\delta$ is an upper bound for $A$, contradicting the fact that $M$ is the supremum of $A$
Since $M^2 \lt 2$ and $M^2\gt 2$ both lead to contradictions, we conclude that $M^2=2$, as required.
The last part is a proof by contradiction, using the fact that $M^2$ and $2$ are related either by $M^2 < 2$ or $2 < M^2$ or $M^2 = 2$, exclusively. In both cases, we contradict the supremum property of $M$; that $M$ is greater than or equal to every number in $A$, and that it is the least such number with that property.
First, assuming $M^2 < 2$, we construct a $y > M$ but $y \in A$, which is impossible if $M$ is the supremum. It's a "little" more than $M$, so add a positive $\delta$ "fudge factor." We have complete control of how little or big that $\delta$ is; i.e. $y = M + \delta$. So, if we want $y\in A, y^2 < 2$, we want $(M + \delta)^2 < 2$. We will work towards this inequality "backwards", although the engineering of the different number choices are much clearer in this direction.
Start with $(M + \delta)^2$, and expand it. Two things happen in $$M^2 + 2M\delta + \delta^2 \leq M^2 + 5\delta$$
First, we use $M \leq 2$ to get $2M\delta \leq 4\delta$. Then, we can choose for $\delta < 1$ so that $\delta^2 < \delta$.
To get this inequality: $$M^2 + 5\delta < 2$$
We can actually work backwards, and choose $\delta < \frac{2 - M^2}{5}$. If we choose $\delta < \min(\frac{2 - M^2}{5}, 1)$, then both the inequalities we need will be true. It's a lot more clear where they come from working backwards, though.
I hope this helps you understand the $M^2 > 2$ part, as well, which works on a similar reasoning scheme.