I came up with a proof for this question, rather simple, that I didn't find here. And I wondered if my proof was correct, and if anyone had a different proof ? Thanks for you time.
I will show that only polynomials in $\mathbb{Q}[X]$ work. My proof is based on induction on the degree of the polynomial,
For d = 0, it is obvious.
Suppose the result true for polynomials of degree $d$, and let P be a polynomial of degree $d+1$ that satisfies the problem, $P(X) = a_0+\ldots+a_{d+1}X^{d+1}$.
Evaluating at 0, we find $a_0\in \mathbb{Q}$. Because $Q$ is stable by multiplication and addition, the polynomial $\dfrac{P-a_0}{X}$ is a polynomial of degree d that satisfies the constraints, the result follows by induction.
Pick any $\deg[f]+1$ rational numbers $q_0, q_2, \cdots, q_n$. Now $f(q_i) \in \mathbb{Q}$, and thus Lagrange interpolation on $(q_i, f(q_i))$ determines $f$ uniquely; But then $$\displaystyle f(x) = \sum_{0 \leq i \leq n}f(q_i) \frac{\prod_{j \neq i} (x - q_j)}{\prod_{j \neq i} (q_i - q_j)} \in \mathbb{Q}[x]$$ since each terms are so we're done.