At the risk of sounding ridiculous, the purpose of the rivets is to hold the plane together. More specifically, they hold the outer aluminum skin to the structural skeleton of the aircraft:
(That skeleton happens to be made of manilla folders, but the real one is pretty much identical except that it's bigger and made of metal.)
You can see the rivets clearly on this particular aircraft because of the paint scheme (all white) and lighting, however if you look closely you can spot them on any 777 nose.
Here's one from an aircraft during assembly, and as the interior has not been installed you can also see the skeleton through the windscreen openings: