Hi Shunya,
You shouldn't let the 30 month rental contract frighten you. It was created as much for the benefit of tenants as it was for landlords.
Before the new law was enacted there was no protection for tenants from a landlord who raised the rent anytime he/she chose to do so, nor from a percentual increase that would be considered abusive in most countries. Now the rent increases are stipulated by law as to dates when they can be made and percentage rate of the increase.
Regarding the contractual fine which goes along with breaking the lease, these only apply to the first 12 months of the contract. The fine is equal to the balance of the unpaid rent for the first 12 months only. This protects landlords from renting out an apartment or house and all the expenses related to that, only to have a tenant break the lease shortly thereafter and needing to go to all those expenses over again. Now at least they are guaranteed one year.
That contractual fine disappears after the twelfth month has elapsed. If you choose to vacate an apartment or house you've rented following that, then you simply give notice (equal to the number of months deposit you have paid) and the landlord is required to then use that deposit as the remaining rent payments until you move. So, as you can see it's really not that bad.
Buying an apartment or house in Brazil is not difficult, but it is a complex process one which also has a number of legal aspects one must be familiar with. There are also a number of taxes that must be paid at the time of purchase and income tax implications as well. This should involve a reputable realtor (corretor de imóveis) and a lawyer to be on the safe side. One need not be a citizen, nor even reside in Brazil in order to purchase real estate here. The only requirement is that the purchaser have a CPF number (Cadastro de Pessoas Fisicas) which you can apply for abroad through the Consulado-Geral do Brasil.
The real worries in purchasing is clear title and status of current occupancy. If there are any leins or the title is otherwise encumbered those pass with the property, so you might end up in a situation where you are assuming someone else's debt without knowing it, so a good title search is imperative. Brazil has a law called "usucapião" essentially squatter's rights. This law provides for aquisition of title after five years of uncontested occupation of the property. Here you have to be sure to actually see the property you intend to purchase, make sure there isn't somebody living there that you can't evict, or worse still that you purchased the property from somebody who no longer has title because it passed to squatters.
There are fees for writing up the purchase/sale contract, deed, registry search of title, registering the new deed, etc. There is a tax the purchaser pays on the value of the transaction ITBI (Impostos sobre Transferência de Bens Imóveis) and a few others that may also apply depending on the property. Once purchased, the purchaser is obligated to file an income tax return in Brazil to report the aquisition and also must report the eventual sale.
One other important thing is to check with the municipal government to make sure the property is properly registered with the municipality, the appropriate permits were all issued and that the plans approved. There is also a legal document called the "Habit-se" which must be issued before a legally registered property can be occupied. This document MUST be in the possession of the purchaser in order to obtain financing (no bank will finance without it). If you purchase a property for cash it won't be a problem until it comes time to sell, since you will be forced to look only for potential buyers who can also afford a cash-on-sale transaction, since they won't be able to qualify for financing. This is a real big problem so don't fall into this trap.
For some strange reason many personal debts surrounding to home ownership, such as utility, telephone bills, contractors bills, etc., are tied to the property, rather than to the individual who incurred those debts. They pass with the title of the property here in Brazil, so you want to see either all of the past bills in order to see they've been paid or at least an annual statement from the service providers that they have been paid.
Cheers, 
William James Woodward Brazil Animator, Expat-blog Team