Apparently there is a way that I can use the fact that for any positive integer $n$ there are positive integers $a$ and $b$ such that $n=a^2b$ where $b$ is the possibly empty product of distinct primes (i.e squarefree?) to show that there are infinitely many primes.
My current tactic (the one that was hinted to me) was to fix x then assuming there are a finite number of primes show that there are only a finite number of possibilities for $n=a^2b$ knowing that $a^2 \leq b$
I believe it is mostly that last part that causes me issues as I am not sure how we can only consider $a^2$ and not $b$. I also assume that I have to do something with divisibility here though I am not sure what. I can't help but think that the overall approach is reminiscent of Euclid's though I am not sure?