Traditionally the caboose is occupied by the guard and a brakeman, who spend the entire journey there. They are responsible for braking the train when needed, and for ensuring the train's safety as it enters and leaves a station. There is a special cupola at the rear of the caboose which gives the guard an elevated view across the top of the train, and the surrounding area.
The guard and brakeman have bunks, a stove and kitchen, a bathroom, a little office, and lots of windows.
One of my favourite scenes in The Boundless takes place in the caboose. At a station stop, Will almost misses the train and has to run to catch the caboose. The guard, a man nicknamed Sticks because he has a wooden leg, takes him in and sets him by the stove to warm up, and gives him a meal (a delicious stew). He gives Will a bed to spend the night, until the next station stop, when he can travel back to the passenger cars.
I think that scene inspired my caboose scene in The Boundless.