Keeping to the left of the...
Keeping to the left of the lane in town will give you a bit of breathing room if a car should pull out of a driveway or street in front of you.
One aspect of street riding we see many riders struggle with is where they position themselves in the lane of traffic. Where you place yourself on the racetrack is for the most part more easily understood, as the requirements are solely performance-oriented. Throw in the unique features of, for example, a road clinging to the side of a mountain, as well as the unexpected characteristics of a public road, and the optimum lane position could be totally different from what you would expect.
In general, the center of any traffic lane is best avoided. Cars leak fluids and drop small parts, and that refuse all collects in the center of the lane, making it slippery with oil and a potential source of flat tires. The slipperiness is especially true at intersections, and doubly so in wet weather. Most traffic situations will require you to be in either the right or left portion of a lane, so there's usually no reason to be in the oily center in any event.
In the city, the left lane is usually the safest option, as you will be farther away from cars turning in and out of driveways and side streets. Especially avoid running up the side of traffic in the often unused right lane in slow or stopped traffic—you'll be a prime target for a car turning left through a break in the traffic. Staying in the right-hand portion of the leftmost lane offers a number of other advantages: As you come up on a car, you'll be in the driver's blind spot for the shortest amount of time. Keeping to the right gives you a bit of a cushion to oncoming traffic. And you'll be able to change to the next lane quickly if needed. Many riders take the extra precaution of moving to the left of the lane briefly when overtaking a car. This has the benefit of both minimizing the driver's blind spot and also leaving the largest possible space to the car at all times.
The right portion of the leftmost...
The right portion of the leftmost lane on a freeway is generally the safest option as it leaves you clear of merging and exiting traffic, yet asserts your use of the entire lane should an errant driver decide to use that real estate.
On the freeway, a similar approach can be utilized. The left hand lane—including the carpool lane—is generally the safest option, leaving you clear of cars merging and exiting. Use the same technique as in the city when coming up on cars: Keep to the right of the lane until you're near the car, and move to the left of the lane to overtake. Likewise, when a car is overtaking you, keep to the side of the lane closest to the car so its driver is not tempted to move over into your lane. If you're worried about getting too close, you can move to the opposite side just as the car comes level. In all cases, keep alert for the actions of the cars around, and consider the blind spots that each driver is dealing with. Your goal is to stay out of those blind spots as much as possible.