Let $f(x)∈\mathbb R[x]$ be polynomial over real number.
I think the following claim holds.
Claim
$∀x∈\mathbb Q$, $f(x)≧0$ implies $∀x∈\mathbb R$, $f(x)≧0$
I think this holds because of density of $\mathbb Q$ in $\mathbb R$.
My question
- Does this claim correct?
- Can we extend this statement to some general results?
Thank you in advance.
The claim is true and the reason is simply because polynomials are continuous functions and because $\mathbb{Q}$ is dense in $\mathbb{R}$.
Assume that $f$ is continuous and $f(x)\geq0$ for all $x\in\mathbb{Q}$. Take $x\in\mathbb{R}$ and find a sequence $(q_n)\subset\mathbb{Q}$ s.t. $q_n\to x$ (because of density). Then $f(x)=\lim_n f(q_n)$ because of continuity. But $f(q_n)\in[0,\infty)$ for all $n$ and $[0,\infty)$ is closed so $f(x)\in[0,\infty)$, i.e. $f(x)\geq0$.