Barney is an ancient, 60 million year-old, Paleocene era rodent skull.
Archie keeps Barney around to prove a point (stated below) throughout the book, until the end, when Barney is buried. Barney acts as a bit of a teaching tool for Archie, and he uses it to explain concepts, ideas, and even life lessons to the many students who pay him visits. When the students are devastated by the basketball team's playoff loss, Archie uses Barney to show the kids that everyone loses in the end. It's just a part of life.