In this question, user begins shows that, for each $k\in \mathbb{N}$, there is a unique polynomial $P_k(x)$ of degree $k$ whose coefficients are in $\mathbb{Q}(q)$, the field of rational functions, such that $P_k(q^n)=\binom{n}{k}_q$ for all $n$.
I've read a bit more about this subject and want to ask this follow up. Suppose $f\in\mathbb{Q}(q)[x]$. Why is it true that $f(q^n)\in\mathbb{Z}[q,q^{-1}]$ for all $n$ if and only if the coefficients of $f$ w.r.t. the basis $\{P_k:k\in\mathbb{N}\}$ belong to $\mathbb{Z}[q,q^{-1}]$? Thanks.