I have become very frustrated and would like to thank everyone in advance for your help.
Flying into Heathrow, want to go to St. Andrews on 7/24 then return to London on 7/27. Had thought about flying but seemed so difficult.
Take train from London's King Cross station to Edinburgh, then train from Edinburgh to Leuchars which is the closest train station. Take taxi to St. Andrews which is only six miles from there.
I would say train it up to Edinburgh, or catch a connecting flight up there. You can take the train as previously suggested, but when I did it, I did it by bus. I THINK it was the X26 bus...don't take my word on that though, it was a while ago. The bus was very cheap, and it drove all along the fife coast which was beautiful. It also gives you the option to stop off in Anstruther and visit the famous fish and ship shop there! Tom Hanks recommends it... :) I must say that I usually don't like busses, but this one was great trip. I actually caught the bus from Dunfermline which is just north of Edinburgh. Anyways, I think the entire round trip journey was like 8 pounds. That was about a year ago. St. Andrews is lovely, enjoy!
If you book NOW at www.nationalexpresseastcoast.com, you can get a fare as low as £15 for trains from London to Leuchars. Since discount fares are non-refundable, leave a minimum of three hours (four hours would be a lot safer) between your scheduled arrival at LHR and your scheduled departure from King's Cross. If your plane is late or there is a delay getting through immigration/passport control, you'll want all the margin you can get. The Tube ride from LHR to King's Cross/St. Pancras will take an hour and costs £4.
For the return to London you might want to take the overnight Caledonian Sleeper train operated by First ScotRail from Edinburgh to London Euston. If booked far enough in advance, Bargain Berths are as low as £19. See here: http://tinyurl.com/g9ehd.