Portugal is small enough that you can reach most destinations by public transport, though a rental car opens up the interior considerably.
Train is the best way to travel between Lisbon, Porto, and Coimbra. CP (Comboios de Portugal) runs the network, and fares are cheap — book eight or more days in advance for discounts of up to 65%. The Alfa Pendular express between Lisbon and Porto takes about three hours. Trains also serve Sintra, Cascais, Setúbal, and the Algarve from Lisbon. Porto connects to Braga and the Minho region. Rural and interior destinations are less well served.
Bus fills in the gaps. Rede Expressos is the main long-distance operator, covering routes trains don't reach. Regional companies handle local connections. Buses are often the only public transport option in the Alentejo interior and smaller towns.
Car is worth considering if you plan to explore the Alentejo, the Douro Valley, or anywhere off the main corridors. Roads are generally good; tolls on motorways add up (most are electronic — rent a transponder or arrange cash-toll-compatible rental). Parking in Lisbon and Porto city centers is difficult and expensive.
Urban transport in Lisbon and Porto is excellent. Lisbon has metro, buses, trams, funiculars, and ferries across the Tagus; the Viva Viagem card works across all of them. Porto has metro, buses, and trams. Digital ticketing is standard in both cities.
Taxis and rideshare (Uber, Bolt, Free Now) operate in all cities and are reasonably priced by western European standards.