The titles says it all. I would like to buy a SIM cart to enable mobile Internet on my phone in all of Portugal, preferably for a month. Is this possible, or is mobile internet only for local residents?
It's possible and easy. You just have to go to one of the many mobile shops around and buy the sim card.
In Portugal there are 3 physical operators:
You also have some virtual operators:
Recharging a pre-paid simcard in Portugal, for someone from abraod, can be a problem since the most common way of doing it is in ATM machines. You probably can't recharge your phone with a foreign ATM card since you only get a small set of operations. The alternative way is to go to the physical shop where you bought the card (or another one from that network) or go to any shop with "payshop". You can find a near by agent here PayShop (only pt).
Lycamobile allows for an on-line recharge.
Just complete the previous answer. In Portugal, there is now a company that rents Wifi hotspots, and sells prepaid data SIM cards, specifically to tourists and non-Portuguese residents. They don't require any contract. Traffic options goes from 1GB to unlimited. They are called Portugal Internet, and you can find them here.