In this paper we present a minimax theorem of infinite dimension. The result contains several earlier duality results for various trigonometrical extremal problems including a problem of Fejér. Also the present duality theorem plays a crucial role in the determination of the exact number of zeros of certain Beurling zeta functions, and hence leads to a considerable generalization of the classical Beurling's Prime Number Theorem. The proof used functional analysis.