At the moment I'm reading Neil Shubin's book Your inner fish. It's a wonderful walk through the evolution of life, taking various aspects of our own biology & tracing their evolutionary history. Over lunch I was reading the chapter on the sense of smell, & some of the ideas there really excited me & I thought I'd share them.
The earliest fish were related to modern agnathans - jawless fish like lampreys. Modern lampreys don't have noses as such, but they do have a single nostril in the middle of the front of their head. This leads to an internal sac, lined with scent-detecting nerve cells - chemoreceptors. Water percolates around the sac & the lamprey can smell (or taste) what's in the water. Modern fish have paired external nostrils. Fish like lungfish & coelocanths, close cousins to land animals, have both external and internal nostrils. So do we, although in our case the internal 'nares' (nostril openings) towards the back of the mouth, separated from food teeth & tongue by the palate. (This is an evolutionary novelty in mammals that allows us to breathe while chewing.) The tiny molecules that trigger our recognition of odours are picked up by receptor proteins in the membranes that line the nasal cavity. Changes in the receptor proteins set off nerve impulses in the olfactory nerve, and your brain registers these as smells.
So there's a sequence of development of the physical apparatus for smelling stuff. Shubin goes on to look at the underlying genes that code for scent receptors. Unsurprisingly, mammals have lots of these & agnathans have far fewer. But - the few that they have, are pretty much the same as some of ours. And it looks as though many of the multitude of mammal odour-receptor genes evolved through duplication of those early jawless-fish genes. And we do have a multitude of odour-receptor genes - Shubin puts it at around a thousand. Just think, 1,000 genes & all of them given over to detecting scents!
But the best is still to come. Humans share those genes with other mammals, but about 300 of our odour-receptor genes are inactive - they contain damaging mutations that render them useless (they've become pseudogenes). This suggests that there's no selective disadvantage in having those genes inactive - but then, humans do rely more on vision than many other animals, and less on their sense of smell. So - what about mammals with no sense of smell at all? They do exist, you know. What would their odour-receptor section of the genome look like?
In whales & dolphins (cetatceans) the nose has evolved into a blowhole. There's no nasal cavity lined with scent receptors; these animals don't smell their way around their world. And their odour-receptor genes? All there - & all in the form of inactive pseudogenes! That is such a glorious story :-)
N. Shubin (2008) Your inner fish: a journey into the 3.5-billion-year history of the human body. Pantheon.