There is increasing interest in the role played by pseudo Nambu-Goldstone bosons (pNGBs) in the construction of (string motivated) models of inflation and of quintessence. In the first part of this talk I will discuss the possibility that one or more pNGBs are responsible for the current phase of acceleration, focusing in particular on the compatibility of such a model with data. Then I will discuss primordial inflation: the pNGB inflaton is expected to be coupled to gauge fields, and will lead to the generation of magnetic fields that can be of cosmological interest. I will analyze the production of such fields mainly focusing on the model of N-flation, where the collective effect of several pNGBs drives inflation. Because the produced fields are maximally helical, inverse cascade processes in the primordial plasma increase significantly their coherence length. I will discuss under what conditions inflation driven by pNGBs can account for the observed cosmological magnetic fields.