First off, no matter what people on the road tell you, you have the right to be on the road, and, in a realistic and mature way, you can and should act like a slow and narrow car. I live in Michigan, so I researched the laws for bikes in Michigan and have presented a breakdown of the rules and rights bikes have. Here is an excerpt from a Michigan law. I would assume that similar laws exist in many other states, and so the information presented here would be applicable in other states as well. The information in this section basically outlines the way I ride my bike.
MICHIGAN VEHICLE CODE
(1) A person operating a bicycle, electric personal assistive mobility device, low-speed vehicle, or moped upon a roadway shall ride as near to the right side of the roadway as practicable, exercising due care when passing a standing vehicle or one proceeding in the same direction. A motorcycle is entitled to full use of a lane and a motor vehicle shall not be driven in such a manner as to deprive a motorcycle of the full use of a lane. This subsection shall not apply to motorcycles operated 2 abreast in a single lane.
(2) A person riding a bicycle, electric personal assistive mobility device, motorcycle, or moped upon a roadway shall not ride more than 2 abreast except on a path or part of a roadway set aside for the exclusive use of those vehicles.
(3) Where a usable and designated path for bicycles is provided adjacent to a roadway, a bicycle rider or an electric personal assistive mobility device operator may, by local ordinance, be required to use that path. Where a usable and designated path for bicycles is provided adjacent to a roadway, a bicycle rider who is less than 16 years of age shall use that path unless accompanied by an adult.
(4) A person operating a motorcycle, moped, low-speed vehicle, electric personal assistive mobility device, or bicycle shall not pass between lines of traffic, but may pass on the left of traffic moving in his or her direction in the case of a 2-way street, or on the left or right of traffic in the case of a 1-way street, in an unoccupied lane.
So what this says is that a cyclist can ride on the road. Even if there is a bike path next to the road, you can still ride on the road, with only two exceptions. (1. There is a local law in the community where the bike path is that says you must ride on it. In that case, I would assume that there would be a sign saying you had to. (2. You are under 16 years of age and are alone.
For the respect of cars, and for your own safety, you should, as the law says, "ride as near to the right side of the roadway as practicable." To me, "as practicable" means that I do not need to ride in the curb, or on the dirt shoulder. Curbs and shoulders are dangerous, with broken glass and uneven terrain.
Section 657 of the law says that a cyclist "has all of the rights and is subject to all of the duties applicable to the driver of a vehicle" This means that a cyclist has both the right and the responsibilities that a car has on the road. This means you should stop at red stoplights, and make use of turn lanes, when it is safe and realistic. It is important that cars know what you are doing or are going to do, so if you act like a car, it should help people figure out what you are going to do.
Yes, you do have to right to get in the middle of the road, when the situation calls for it. Although Section 660 Part 1 says the a bike should stay as close to the right as possible, it does say in Part 4 that you can pass to the left of traffic that is slower than you.