Los Angeles to San Francisco by Bus
A convenient Shuttle Bus runs between Monterey Park (east of downtown LA) and San Jose, Cupertino, San Francisco or Oakland. There's only one trip offered a day, leaving in the morning from each place. Cost is about $100 round trip and it takes about 8.5 hours to travel between Monterey Park and downtown San Francisco.California Shuttle Bus picks up and drops off at several locations on both ends of the route, departing at noon and midnight only and taking about 7.5 hours. They say fares start as low as $5, but most of them run about $40 round trip.
Los Angeles to San Francisco by Train
The Amtrak Coast Starlight line runs from Los Angeles' Union Station to San Jose or to Oakland's Jack London Square but does not go to the city of San Francisco. However, they do offer train/bus combinations that can get you there.The Amtrak trip from LA to Oakland takes a little over 11 hours and costs $60 to $70 one way. Some of their options include long rides on a bus (look for the little bus icon) and in some cases, you'll have to change conveyances twice to reach your destination.
You can also take an Amtrak train to San Jose, where you can transfer to Caltrain to get to San Francisco. This option will add a little less than $10 to your trip cost each way.

