Valuations, primes and irreducibility in polynomial rings and rational function fields