Assume the opposite, that there are exactly n primes. Let set S contain all n primes in increasing order, such that S={X1, X2, X3... Xn}.

Consider Y such that Y=1+(X1*X2*X3*...*Xn)

Y gives a remainder of 1 when divided by any element of S. Hence Y is not divisible by any prime and must be a prime itself. Yet this contradicts the assumption that there are only n primes, as the existence of Y means there must be at least n+1 primes.

The assumption must then be false and there must be infinitely many primes.