I would say to take a Subaru you are considering buying to a Subaru shop and pay for a pre-purchase inspection. It might cost you about $89 or so, so I would only do it if you're seriously considering that purchase. I've owned a 2007 Outback and a 2009 Legacy and both were bulletproof cars, but I am no car guy either.
Get a subscription to Carfax and check the maintenance records of any car you want to buy. There's a free beta out right now for a limited carfax service called mycarfax.com -- it will show you oil changes and repairs for free, but not things like whether the car was totaled or salvaged in the past. You just need the VIN or license place number of the car.