In A series related to prime numbers the function $H(t)$ is defined with a hint, that it is a Hilbert–Poincaré series of $V := \bigoplus_{n\in \mathbb{N}} V_n $, where $V_n := \left\langle \log(1), \cdots, \log(n) \right\rangle_{\mathbb{Q}}$ where it is used that:
$\log(n) = \sum_{p\mid n} v_p(n) \log(p)$
$\log(p)$ with $p$ prime, are linearly independent over the rational numbers.
Then $\pi(n) = \dim_{\mathbb{Q}}(V_n)$.
Furthermore in the question above it is shown that:
$$H(t) = f(t)/(1-t)\quad\text{where $f(t) = \sum_{p \text{ prime }}t^p$.}$$
Now $f(t)$ is clearly not a polynomial, since we know by Euclid that there are infinitely many primes.
On the other hand, if the Hilbert–Serre theorem could be applied in this situation, $f(t)$ would be a polynomial.
Hence, a proof of the infinitude of primes might be like this:
Suppose that there are finitely many primes. Then the Hilbert–Serre theorem can be applied resulting in $f(t)$ being a polynomial. But by a clever argument of some kind, if one could show that $f(t)$ is not a polynomial, without using the infinitude of primes, then one could deduce that there are infinitely many primes.
Q1) Since my commutative algebra knowledge is a bit rusty, I am asking for help, if it is possible to make the argument above work or not: Assume there are only finitely many primes. (Under this assumption and the definition of $f(t)$ it follows that $f(t)$ is a polynomial.) But my question is: Does it follow from the Hilbert–Serre theorem that $f(t)$ must be a polynomial?