Tips: The nearest attractions are Olvera Street, Chinatown and Little Tokyo. Olvera Street is very close to Union Station and the others are within walking distance, although it's not a short walk. Anything else will require a bus ride. The large buildings are not within reasonable walking distance from Union Station.
If you are just sightseeing and do not have a specific destination, try Santa Monica or Hollywood, rather than downtown LA.
Getting there: From LAX, a bus ride takes 30-60 minutes each way (including transfers). You can take the FlyAway Union Station service from the terminal at LAX to downtown Los Angeles. (Use MTA's Trip Planner to find the best route for your departure time.)
MTA's Metro Trip Planner displays schedules and fare information for LA metro buses and trains. It's fast and easy to use. Simply visit the MTA's website at Metro.net and you'll find the Metro Trip Planner on the top right side of the home page.
MTA's Metro Trip Planner
Time estimate: You will need a few hours to walk around and browse shops. So you will realistically need at least a 5 hour layover for this type of excursion. On planning for your return trip to LAX, don't forget to allow an additional hour to get through security and walking through the terminal at LAX.