All houses built in the United States must be built to local and national construction standards. Floors are required to be able to withstand about 40 pounds per square foot of weight at the weakest point. A heavy bookcase would likely be spread over several support joists beneath the floor, which distributes the weight so that no single point is tasked with providing an inordinate amount of support. This is not to say that it is impossible for a bookcase to make a floor sag, only that it is highly improbable.
If you have a heavy bookcase in a second- or third-floor room, the odds are greater that the excessive weight could cause floor sagging, mainly because there is a tendency to overspan joists on upper floors rather than the bottom floor. Where main floors almost always have a joist every 6 to 8 feet, a building contractor might not be so particular on an upper floor, where it's harder to install heavy wooden or steel beams. This is not to say that upper floors are not code compliant, only that they might have less margin for error than a main floor, which holds the entire weight of the house.
If you have some concern that your bookcase is so heavy it is making your floor sag, the obvious answer is to distribute the weight horizontally to prevent further damage or break up the weight between several smaller bookcases. Depending upon the exact problem, repairing a sagging floor might be as easy as jacking up the low spot and adding shims to bring it back level, or as complicated as adding new supports and pylons that might cost thousands of dollars. It makes sense to have an experienced floor contractor offer an opinion of the cost and scope of the operation first.
A common cause of floor sagging is compacting or shifting soil. The problem with going to the time and expense of a fix is that the soil might easily go on compacting after the repair has been made, thus creating a sagging floor all over again. It is up to you to decide if the sag is bothersome enough to fix or whether it wouldn't be so bad to simply live with it.