I did an experiment with my camera (Canon 5diii with 100mm F2.8 macro lens at F8) to see if I could determine what limited the resolution of the lens. I photographed a 30cm rule four times: the whole length, half the length, a quarter the length and an eighth.
056A3432 by tonyw36, on Flickr
056A3433 by tonyw36, on Flickr
056A3434 by tonyw36, on Flickr
056A3435 by tonyw36, on Flickr
If you look at the versions on Flickr, you see that the width of the images is the full 5760 pixels so that for the first picture of the full length of the rule there are 19 pixels to the millimetre. For the last image it is about 150 to the millimetre.
I zoomed in on each of the these images keeping one of the distance marks in the centre (I chose the 2 cm line) until the individual pixels were clearly visible. From the last image, we can see that the line is about 30 pixels wide, i.e. about 1/5 mm.
We can see on all the images that the change from white to black occurs over a something like 7 pixels, although most of the change occurs over about 4 pixels. (I think you have to see it to understand what happens but I have not been able to display an image which is only a few pixels wide here.)
My conclusion is that it is the lens which limits the resolution, not the pixel density.
Does anyone agree that this experiment makes sense? If so, it would be interesting for people with other cameras to do a similar test. Also, to test other lenses and different apertures.