The general answer is: "it depends on how long you want to live there".
Here is a good calculator to figure it out:
http://www.nytimes.com/interactive/business/buy-rent-calculator.html
Basically, if you plan to move in a few years, then renting makes more sense. It is a lot easier to move from an apartment when your lease is up versus selling a house, which can be subject to fluctuations in the real-estate market. As an example, during the real estate bubble, a lot of "young professional" types bought condos and town homes instead of renting. Now these people are married with kids, need to move somewhere bigger, but they can't get rid of their old place because they can't sell it for what they still owe. If these people had rented for a few years, they would be in a better position financially. (Many people fell for the mantra "If you are renting, you are throwing your money away", without looking at the long-term implications.)
However, your question is a little unique, because you mentioned renting for the rest of your life, and putting the savings into an investment, which is a cool idea. (Thinking outside the box, I like it.)
I'm going to assume you mean "rent the same place for many years" versus "moving around the country every few years". If you are staying in one place for a long time, I am going to say that buying a house is probably a better option. Here's why:
- With a mortgage, at some point you stop sending a check every month. With rent, the payments never stop.
- At the end of the mortgage, you have an asset that is worth a lot of money (your house). You can sell it and travel the world, give it to your kids, etc. (EDIT: With the rent+invest approach, you would have your investment portfolio as a sizable asset. It is open to discussion which one would come out ahead.)
- With a mortgage, your payments are a fixed amount (unless you have an ARM). Inflation drives prices up over time, but your mortgage payment stays the same. In fact, inflation helps the homeowner by making the last mortgage payment "cheaper" than the first one. Rent prices tend to keep pace with inflation. Your landlord will probably increase the rent periodically.
- There are tax advantages to buying a house (in the US anyway). Your mortgage interest is a tax deduction. There are also tax credits for certain home improvements (e.g. installing an energy efficient A/C). You can't take advantage of these when you rent.
- Over the long term, home prices do go up (population is increasing, but there is a finite amount of land). I am not saying the house is a good "investment", but its value normally won't evaporate over 30 years like some other assets would. In terms of inflation-adjusted dollars, your house should maintain similar "value" over the years, as long as you stay on top of the upkeep (and your neighborhood doesn't become run-down).
- With a mortgage, you are paying interest to a bank, which some would consider to be a "black hole" just like rent. However, you can reduce the money you pay in interest by making extra mortgage payments. Making 1-2 extra payments at the start of your mortgage can save a huge sum of money over the life of the loan.
So what about investing? Let's look at some numbers:
- Investing in the Dow Jones Industrial Average would give you ~9% per year, with a lot of volatility (source).
- Mortgage rates are hovering at about 5% right now. (source)
- Seems like a good idea to invest, instead of taking out a mortgage, right?
- Now, add in an inflation rate of ~3% (source)
- Inflation erodes the effective stock market return, but it helps your mortgage payment by effectively making it cost less over time.
- Next think about taxes.
- That 9% stock market return is taxable income (which eats into your effective return), whereas the mortgage interest is a tax deduction.
- Inflation and taxes pretty much negate higher rate of return for the stock investment.
- Additionally, you have the inflationary impacts of a rent payment that increases over time.
So, based on the above, I say that buying a house is the way to go (as long as you plan to live in the same place for several years). However, if you could find a better investment than the Dow, or if mortgage interest rates change drastically, things could tip in another direction.
Addendum: CrimsonX brought up a good point about the costs of owning a house (upkeep and property taxes), which I didn't mention above. However, I don't think they change my answer. If you rent, you are still paying those costs. They are just hidden from you. Your landlord pays the contractor or the tax man, and then you pay the landlord as part of your rent.