Pyridine is an aromatic heterocyclic compound (according to Huckel - Von Dering rule) with chemical formula C5H5N. The structure is really similar to benzene's one, with six π electrons delocalized on the molecule, on six p orbitals, with just one fundamental difference. A methine group (and therefore one carbon) is replaced by the heteroatom N, nitrogen. Nitrogen has a lone pair on an sp2 orbital (N.B: here lies an important difference with pyrrole, whose lone pair is involved in aromaticity) and therefore gives a particular reactivity and acid-base properties.
The other important element that we have to consider is the electronegativity of the nitrogen atom, extremely higher than carbon's (N → 3.0 , C → 2.5). Consequently the HOMO of the pyridine is lower in energy, in other words nitrogen atom drains most of the electron density, localizing it on itself, and turning the aromatic ring in a worse nucleophile.
Acid - base properties
As we antcipated in the introduction, pyridine's lone pair available on an sp2 orbital gives specific properties to the heterocycle concerning reactivity and acid - base behaviour. Considering that the electron pair isn't delocalized on the ring (they aren't π electrons) and therefore it doesn't take part in aromaticity can easily accept a proton.
Anyway, as base, pyridine is weaker than aliphatic amines (pyridinium ion has a pKa approxymately of 5.5. Why?
The reason lies in the feature of the lone pair. If we compare the lone pair of the pyridine and the lone pair of ammonia or whatever aliphatic amine, what's different? The main difference is the structure of the orbital in which they lie. In pyridine the lone pair is located in an sp2 orbital that has a larger s coefficient, differently from aliphatic amines (sp3). This means that electrons in sp2 orbitals are more close to the nucleus, and therefore less available to bond a proton and less reactive in general (that is even more true for sp orbitals, N2, for example, is completely unreactive)
Pyridinium salts are very stable and sometimes they are used to carry in organic solution inorgainc anions.
Reactivity (as nucleophile)
Notwithstanding pyridine isn't such a great nucleophile (because is sterically hindered) its lone pair can be used in certain reactions, on particularly activated electrophiles. When nitrogen uses its lone pair the result is a positive charge (4 electrons in the outer shell) and therefore a salt.
(N-etyl pyridinium iodide)
Is often used as a solvent and nucleophilic catalyst, for example in esters synthesis starting from acid chlorides.
Reactivity: electrophilic aromatic substitution
In normal conditions pyridine ring is very unreactive and you could compare it with a nitro-benzene. The nitrogen atom in pyridine gives towards electrophilic aromatic substitution the same properties given by the nitro group. The nitrogen drains electron density, the HOMO is lower and therefore pyridine is a worse nucleophile than benzene (and benzene itself is not that reactive).
Don't forget, in an electrophilic aromatic substitution the nucleophile is the aromatic ring!
Energy consideration aside, there's another problem given by the nitrogen atom: the lone pair. Considering that the ring is unreactive what immediately comes to our minds is to use an activated electrophile. But if we used, for example, a Lewis's acid as catalyst, i.e AlCl3 to do a Friedel - Kraft, that catalyst, instead on activating the electrophile would react in an acid-base with the pyridine. Exactly the same if we used whatever acid. Resuming, pyridin is incredibly unreactive towards electrophilic aromatic substitution (we could anyway succed to carry on some substitution, i.e nitration, with bad yields)
Fortunately, there's a way to solve all this problems.
The lone pair can indeed be useful to turn pyridine in a pyridine N-oxide:
Agents commonly used to produce pyridine N-oxide (therefore to oxidize pyridine) are peroxides like hydrogen peroxide in the example or peracetic acid, oxygen atoms donor, with a weak O-O bond.
Pyridine N-oxide is colourless stable solid. In spite of formal charges you may have noticed, it's globally neutral, and the resonance structure (mesomeric effect) explains the stability (observe that nitrogen lone pair is no more available, because engaged in a dative bond. The molecule is no more basic and no more nucleophilic at the nitrogen)
These formulas justify also another big difference between pyridine and pyridine N-oxide. The latter is indeed electron-rich, and resonance structures show how the negative charge can be succesfully delocalized on the ring, particularly on -2 (or -6) and -4 positions:
Now that pyridine is electron rich can undergo electrophilic aromatic substitutions:
What's amazing is that we can bring an electrophile on pyridine N-oxide ring and then, in a second step, using a reducing agent, bring back our pyridine. Another reason why pyridine is such a versatile compound.
To reduce pyridine N-oxide the most commonly used agents are chloride derivatives such as POCl3 or P(OMe)3.