I am currently learning Number Theory and one of the appendices of the book I am currently using introduces algebraic numbers and algebraic integers. One of the exercices is to prove the statement in the title: Prove that if $\alpha$ is an algebraic number and a root of $f(x) \in \mathbb{Z}[x]$ where $f$ has leading coefficient $a$, then $a\alpha$ is an algebraic integer.
However, that statement does not make sense to me when looking at the definition of these objects. If $\alpha$ is a root of $f(x)$ then $\alpha$ is an algebraic number, but since $f(x)$ has leading coefficient $a$ then $f(x)$ is not monic sur $\alpha$ is not an algebraic integer.
Now, I thought about taking the function $g(x) = \frac{1}{a}f(x)$ so that $g(x)$ is monic, but then $g(x)$ might not be in $\mathbb{Z}[x]$ but we would have $\alpha$ an algebraic integer. However this does not solve the issue of $a\alpha$ being an algebraic integer. I have tried coming up with an example but even with simple ones it does not make sense to me. Take $$f(x) = 2x^2 - 4$$
then $\alpha = \sqrt{2}$ is a solution and $f(x)$ has leading coefficient $a = 2$ so we can apply the statement I am trying to prove and get that $2\sqrt{2}$ is an algebraic number but, even if we forget about the monic part of the definition: $$f(2\sqrt{2}) = 2(2\sqrt{2})^2 - 4 = 16 - 4 = 12 \neq 0$$
So $2\sqrt{2}$ is not a root of $f(x)$ therefore it is not an algebraic number, even less an algebraic integer.
What am I doing wrong? Is my understanding of these objects wrong in some way?