Buying is a great idea, if you know the area well (what neighborhoods are good/bad, how property values have appreciated, etc) and if you can handle the down payment and mortgage payments for the property you're interested in. A realtor can help you with this, but do your own homework too.
When you buy, every time you make a mortgage payment, you're building up equity. If you later sell and move, you can potentially make a nice profit. If you rent, you have nothing to show for it at the end of your lease. Plus, your mortgage interest is tax deductible.
Good luck.