Welcome to the Apple Support Communities
First, check if your computer is supported > http://support.apple.com/kb/sp575
Then, buy Snow Leopard > http://store.apple.com/us/product/MC573/mac-os-x-106-snow-leopard After that, make a backup, insert the DVD and upgrade.
Finally, open > Software Update and install the most recent version. If you want and your Mac is compatible, you can open App Store and purchase Mountain Lion to upgrade to the most recent OS X