Indeed can be used as an adverb or an interjection. It means truly, in reality, or in fact.
As an adverb: "Mary did indeed go to the doctor." "Indeed, it did rain." - It is usually used when there may be some doubt OR suprise as to whether or not something happened. If Person A doubts that Mary went to the doctor, Person B can assure Person A that Mary went by saying, "Mary did indeed go to the doctor."
As an interjection: "Indeed!" - This is usually used as an expression of agreement.
Person A: "People should not allow their children to run around the restaurant."
Person B: "Indeed."
Person A: "Are you going to college in the fall?"
Person B: "Indeed."
Hope this helps! ^-^