If you are experiencing muscular back pain, there's a good chance it will go away on its own with time. But you should see a doctor right away if back pain is severe, occurs after a fall or injury, doesn't improve when you lie on your back or is accompanied by one or more of the following:

Weakness, pain or numbness in one or both of your legs
Fever or unintentional weight loss
Pain with urination or difficulty urinating

Diagnosing back pain will begin with a physical exam and medical history.

Medical History  
During the medical history your doctor will ask you questions, such as:

What symptoms are you experiencing?
Did they begin suddenly or come on gradually?
Are your symptoms worse after activity or rest?
Are there certain activities that make your symptoms worse – or better?
Are you experiencing pain or swelling in other joints?
Are you experiencing symptoms anywhere besides the back?
Have you ever had cancer?
Have you had unexplained weight loss?
Do any of your family members have arthritis or other back problems?
Do you have other medical problems that could be causing your symptoms?
Do you spend a lot of time sitting at a desk?
Do you exercise regularly? If so, what kind of exercise do you do?
Do you smoke? If so, how much?

Physical Exam
During the physical exam your doctor will check your posture and look for problems such as curvature of the spine.

Your doctor may ask you to stand and walk to determine if back pain is affecting your gait (the manner in which you walk) or if an awkward gait (perhaps due to leg-length discrepancy or arthritis in the knee or hip) may be contributing to your back pain.  

Your doctor may ask you to move, bend and change position to see if a particular activity or position makes your pain worse. Your doctor may also press on different parts of your body – even parts where you may not be aware of pain – to check for tender points (tender painful areas that are characteristic of fibromyalgia) and trigger points (areas of the body that, when pressed, cause pain elsewhere) to locate the source of your pain.