When I build a building, say a granary, a couple turns later I have the option to rebuild it. I am wondering whether this is because the building has used its effect and has been consumed? Or just why in general?
Are you sure it was a granary? This sort of thing often occurs with national buildings.
To build the National College, for example, you have to have a Library in every city. Let's say you start building the National College. A few turns later, you conquer an opponent's city that doesn't have a Library. Your National College will stop building, and you'll be prompted to build something else in that city.
If you build (or buy) a Library in your newly-conquered city, you'll get the option to build the National College again. It'll take your previous progress into account, and start from where you left off.
So you're not being asked to rebuild a building, but it might look that way because you'll see the National College again and think "Didn't I already build that?" It's because you lost the prerequisite condition to build it, but then later obtained that condition again.