The degree of a (nonzero) polynomial is the highest power of the variable appearing which has a nonzero coefficient. In the expression on the left, we do not know the values of $a_0,\dots,a_n$, so the degree of the left side could be any value up to $n$, or it might be the zero polynomial.
The right side of the equation is the zero polynomial. The zero polynomial has infinitely many roots, since for every value of $x$, $0$ is still $0$. Due to the equality between the left and right sides, the left side also has this property.
The argument in the textbook says that, if the polynomial weren't the zero polynomial, then there would be a contradiction due to the fundamental theorem of algebra. Thus, the polynomial must be the zero polynomial.
Part 1 is still kind of nice; depending on what you need this for this may or may not be useful:
For a real polynomial, its roots are either real or form conjugate pairs. If you have two conjugate roots of unity
$$e^{\frac{2i\pi k}{n}},\ e^{-\frac{2i\pi k}{n}},$$
then the quadratic polynomial with them as roots is
$$P(x)=x^2-2\cos\left(\frac{2\pi k}{n}\right)x+1.$$
So, any real-coefficiented polynomial (whose roots are all roots of unity) has the form
$$(x+1)^m(x-1)^n\prod_{k=1}^N \left(x^2-2\cos\left(\frac{2\pi a_k}{b_k}\right)x+1\right),$$
where $m,n$ are nonnegative integers and all $a_k,b_k$ are positive integers (with $a_k<b_k$, if you wish).
For part 2, I mean, you can just pick the roots to be
$$x_k=e^{\frac{2i\pi a_k}{b_k}},$$
and your polynomial will be
$$\prod_{k=1}^N \left(x-e^{\frac{2i\pi a_k}{b_k}}\right),$$
but this probably isn't that useful. Another thing that may or may not be useful for either of these is that all polynomials with only roots of unity as roots have roots that all satisfy $x^M=1$ for some (possibly large with respect to the degree of the polynomial) integer $M$. In the case above this $M$ can be taken to be $b_1b_2\cdots b_k$. So, all polynomials with only roots of unity as roots are factors of $x^M-1$ for some $M$.
Best Answer
Since a good proof of this on MathOverflow has already been linked in the comments, I will provide an alternate and original proof.
Firstly, note that we may write $f(x)=x^r g(x)$ for some monic $g(x)\in\mathbb{Z}[x]$ with no roots at $x=0$.
Let $n=\deg(g)$, and let $\alpha_1,\cdots,\alpha_n$ be the roots of $g(x)$. Define the sequence
$$A_k=\alpha_1^k+\alpha_2^k+\cdots+\alpha_n^k$$
It is a fact that the fixed field of the Galois group of a splitting field of a polynomial in $\mathbb{Q}[x]$ is $\mathbb{Q}$, so since $A_k$ is fixed by every automorphism in $\text{Gal}(\mathbb{Q}(\alpha_1,\cdots,\alpha_n)/\mathbb{Q})$, then $A_k\in\mathbb{Q}$. Furthermore, since $\alpha_i$ are algebraic integers, then so is $A_k$, and since $A_k$ is also rational, then it must be an integer. (note that this fact can also be proven by combining of Newton's identities and Vieta's formulas)
Now, note that since $|\alpha_i|\leq 1$, then
$$|A_k|\leq |\alpha_1|^k+|\alpha_2|^k+\cdots+|\alpha_n|^k\leq n$$
Combined with the fact that $A_k$ is an integer, this means that $A_k$ only takes on finitely many values. Writing, $g(x)=x^n-b_{n-1}x^{n-1}-\cdots-b_1x-b_0$, we know that $A_k$ satisfies the linear recurrence
$$A_k=b_{n-1}A_{k-1}+\cdots+b_1A_{k-n+1}+b_0A_{k-n}$$
Since $A_k$ satisfies a linear recurrance and takes on only finitely many values, then $A_k$ is periodic with some period $m$. This means that $A_{mk}=A_0=n$ for all $k\geq 0$. Therefore, for $|x|<1$, we have that \begin{equation} \begin{split} \frac{n}{1-x}&=\sum_{k=0}^\infty nx^k\\ &=\sum_{k=0}^\infty A_{mk}x^k\\ &=\sum_{k=0}^\infty \sum_{i=1}^n \alpha_i^{mk}x^k\\ &=\sum_{i=1}^n\sum_{k=0}^\infty\alpha_i^{mk}x^k\\ &=\sum_{i=1}^n\frac{1}{1-\alpha_i^mx}\\ \end{split} \end{equation} and therefore, multiplying both sides by $1-x$, and taking the limit as $x\rightarrow 1^-$, we have that \begin{equation} n=\lim_{x\rightarrow 1^-}\sum_{i=1}^n\frac{1-x}{1-\alpha_i^mx}\\ \end{equation} Notice that if $\alpha_i$ is an $m$-th root of unity, then $\lim\limits_{x\rightarrow 1^-}\frac{1-x}{1-\alpha_i^mx}=1$ , and otherwise $\lim\limits_{x\rightarrow 1^-}\frac{1-x}{1-\alpha_i^mx}=0$. Combining this with the formula above tells us that $g(x)$ has precisely $n$ roots $\alpha_i$ which are $m$-th roots of unity (this is every root of $g(x)$).
Equivalently, every root of $f(x)=x^r g(x)$ is either $0$ or a root of unity, as desired.