Edinburgh Castle is one of the most famous tourist attractions in the city of Edinburgh, in fact, in the whole of Scotland. It has been there for many centuries, starting from early fortifications with succeeding kings either building on top or replacing the existing structures. The castle sits on a natural defensive fortification, a volcanic plug that rises above the surrounding area and hence provides a natural line of defense (although it does make getting supplies inside in the case of a siege more difficult).
Edinburgh Castle is also famous for another more sinister reason, it is supposed to be haunted (although since most people visit it in the daytime, you won't see people running out of the place scared). These haunted sections are typically supposed to be in the underground dungeons and tunnels connecting to the Royal Mile (there has been no proof though, so consider this with a pinch of salt).
The metal Portcullis set as part of the stone doorway near the entrance of Edinburgh Castle. The purpose of this metal device was simple. At the sign of any danger or as part of normal security procedures, the metal structure with thick bars would be lowered to ground level, setting another barrier against enemies who had managed to penetrate inside the Castle to this point. Now of course, it is permanently raised, just being there so that visitors can also note the presence of one of the security structures located inside the castle.
The audio clue (also meant for those who have rented headphones for an audio guide to the castle) telling visitors that these stone walls have been guarding the inside of the castle for over 2000 years, maybe in different versions. But these high and thick walls have been protecting the castle for millenia now, ever since fortifications were setup on this site (located at a much higher level than the surroundings).
A grand and sweeping outdoor staircase inside the Edinburgh Castle. The blue sign that you see announces an exhibition inside the Argyle tower, a tower that got its name from politics and death (it was the tower that was apparently housing the 9th Earl of Argyle before he was finally executed in 1685). The castle seems very well maintained, and it is pretty safe to walk all around the castle without worrying that any of these structures (or part of them) will come down.
The Edinburgh Castle has a number of different buildings inside it, as you would expect, given that the castle had a large number of people living inside it, and was expected to hold out for long periods of time during a siege by enemy forces. In addition to the royal family, there would be the garrison (royal guards and others), and the staff catering to the royal family. Some of them are at different levels, some of them have lower levels (or basements), walking through the entire Castle can be tiring for those not used to walking so long.