Madrid's Barajas airport is often the best option for getting in and out of the city; the trains can be just as expensive as flights, and buses are a bit of an endurance test. Driving is quite a good option, as Spain's main highways feed into Madrid, but they can be a little terrifying for the inexperienced.
Madrid is well served by an excellent and rapidly expanding underground rail system (metro) and an extensive bus service. In addition, you can get from the north to the south of the city quickly by using cercanías (local trains) between Chamartín and Atocha train stations. Taxis are also a reasonably priced option.
Buses operated by Empresa Municipal de Transportes de Madrid (EMT) travel along most city routes regularly between 06:30 and 23:30. Twenty-six night-bus routes (búhos, or líneas nocturnas) operate from 24:00 to 06:00 from Plaza de la Cibeles.
Madrid's modern metro (www.metromadrid.es) is a fast, efficient and safe way to navigate the city, and generally easier than getting to grips with bus routes. The metro covers 284km (with 294 stations), making it Europe's second-largest metro system, after London. Central Madrid has 11 colour-coded lines and operates from about 06:00 to around 02:00.
Citizens of EU countries can enter Spain freely with their national identity card or passport. Non-EU nationals must take their passport.
Spain is a signatory of the Schengen Agreement, as such there are no passport controls at borders between Andorra, Austria, Belgium, Denmark, Finland, France, Germany, Greece, Iceland, Italy, Liechtenstein, Luxembourg, the Netherlands, Norway, Portugal, Spain, Sweden, Switzerland and many of the Eastern European EU members such as the Czech Republic. Think of this zone as one country in terms of your three-month stay. It won't work to try to stay in each of the countries for three months. So if you are planning to stay in Western Europe for longer than three months, make certain that you leave the Schengen zone before your 90 days are up (say by a jaunt to the UK or Ireland) and then return, getting a new entrance stamp in your passport.
Nationals of Australia, Canada, Israel, Japan, New Zealand and the USA need no visa for stays of up to 90 days, but must have a passport valid for the whole visit.
Norwegian, Swiss, Icelandic and EU nationals planning to stay in Spain more than 90 days are supposed to register with the police and obtain a resident's number during their first month in the country.
Those needing a visa must apply in person at the consulate in the country where they are resident. South Africans are among the nationalities that do need a visa. You must obtain the visa in your country of residence. Multiple-entry visas will save you trouble if you plan to leave Spain for Gibraltar and/or Morocco, then re-enter it. Visas are not renewable.
If you have any doubts at all about whether you require a visa or not, or for any clarification regarding entry requirements, contact the Spanish embassy or consulate in the country where you reside before you leave.