The State Library of New South Wales did a little future forecasting and compiled their results in a nice white paper called Bookend Scenarios (pdf). Although they were focusing on particularly Australian concerns, I was surprised by how applicable their vision is to American libraries. We face very similar challenges to our services, and it's worth taking a look at this report if you are concerned about the public library and its future incarnations.
Above is their matrix of change, with a sector for each of four scenarios named after seminal monographs: nonfiction for generalized scenarios, and fiction for the niche scenarios. The predicted outcomes of each scenario will depend on variables in our socioinformatic landscapes.
Right now, I'd say the average American public library is in the How Buildings Learn quadrant - technology is accelerating & formats are unstable but library services & buildings are expanding to meet community desires. Barring some global catastrophe after Peak Oil, I'd say American libraries are typically headed for a mashup between the Neuromancer and Fahrenheit 451 scenarios. In particular, I think that electronic formats will win the day for most sources of nonfiction and the physical paper-based book will become the province of fiction exclusively. I don't think that we will suffer from the lack of relevance forecast in the Fahrenheit 451 scenario, but I do believe we will find value in the Neuromancer prediction: people's skepticism of information could be tempered by situating librarians as arbiters of content, where we help users discern bias and conflicts of interest in the production of specific pieces of information.
Where do you think public libraries are headed in the next 20 years? We will surely follow society's lead, and the four visions in this fascinating project are distinctly possible versions of our collective future.