The BRST cohomology of the N=2 supersymmetric Yang-Mills theory in four
dimensions is discussed by making use of the twisted version of the N=2
algebra. By the introduction of a set of suitable constant ghosts associated to
the generators of N=2, the quantization of the model can be done by taking into
account both gauge invariance and supersymmetry. In particular, we show how the
twisted N=2 algebra can be used to obtain in a straightforward way the relevant
cohomology classes. Moreover, we shall be able to establish a very useful
relationship between the local gauge invariant polynomial trϕ2 and the
complete N=2 Yang-Mills action. This important relation can be considered as
the first step towards a fully algebraic proof of the one-loop exactness of the
N=2 beta function.Comment: 22 pages, LaTeX, final version to appear in Journ. Phys.