This may be a stupid question, but I was just curious as to whether or not you have to buy a new ticket if you change lines on the metro in Madrid.
There is no stupid question, on the contrary I think it is wise to ask about what is unknown to one.
Short answer to your question: No, one ticket is enough, and this is valid for 99% of the trips a tourist can do.
Long answer: The Madrid metro network is actually composed of three sub-systems, and has three different fares:
One is the Southeastern leg of line 9 (Puerta de Arganda-Arganda del Rey). This subsystem is operated by TFM.
The second one is the line 12 in full, plus the two Southernmost stations in line 10 (Joaquin Vilumbrales and Puerta del Sur). This subsystem is called Metrosur.
The last one is the rest of the network, that includes all stations and lines into Madrid city limits. It is called Metromadrid.
If your trip's departing point and destination are not in the same subsystem, you have to use a ticket called 'Combined' and it is 1.30 euro. Else, the ticket to use is a 'Single' one and it is 1.00 euro only. If you want to save money, there are 10-trip tickets that all cost 5.80 euro, but are different for each subsystem. The one valid for downtown Madrid is called Metrobus and it is valid for 10 trips either on Metromadrid, or Madrid buses, or both (i.e., 5+5, or 7+3, or...). There are others for Metrosur and TFM and they cost the same, but are valid only for their respective subsystems.
For a fully detailed explanation about fares, please refer to
here , a Madrid Metro Official Website page.