5. Assume there are only finitely many such primes, let them be p1,p2,⋯,pk.
We consider (2p1⋯pk)2+1=p. By assumption and p≡1(mod4), so p is not a prime, let p0 be a prime factor of p, p0 is of course odd, so -1 is a quadratic residue modulo p0, i.e., (p0−1)=1, thus p0≡1(mod4), but p0 is clearly not p1,p2,⋯,pk, which contradicts the assumption.
Therefore, there are infinitely many primes of the form 4k+1.