Thanks for your question, and I recommend that you speak with your doctor
. Most of the muscles to the arm attach to the rib cage, which changes in size with breathing. The nerves to your arms do run alongside the thoracic cavity as well, and so taking a deep breath in will compress or move these nerves to some degree. Usually that does not result in any symptoms for the majority of people, but in your case it appears to be causing some pain. Thinking anatomically, the problem could lie either somewhere in your arm, where the movement of the nerve is pinched by some problem further down the arm. More likely, problems with the more proximal aspects of the nerve, such as the thoracic cavity itself. Perhaps even more likely, where the nerve leaves the spine it is not uncommon for the nerve to be pinched from some sort of spine problem. Of course, the only way to know for sure what is causing your symptoms is to speak with your doctor. He or she will be able to do a physical examination, ask more questions, and perhaps get some imaging that can help to determine what is causing these symptoms. Please speak with your doctor about this question, and good luck.