Hello from JustAnswer. This is Dr. Love.
There are several problems that can cause pain in this location.
The liver typically is just under the edge of the rib cage on the right, so liver problems can cause pain that is felt under the rib cage. The liver actually also extends slightly to the left side as well, but the great majority of the liver is on the right side. the gallbladder that was removed was lying on the underside of the liver.
It is also possible that have pain in this location from problems in the stomach or small intestine, as these organs lie below the liver on the right side.
However, when the pain is worse with taking a breath, that is usually not from problems of the liver, stomach, or small intestine. Instead, it would suggest that it is either due to inflammation of the rib cage or inflammation of the lung, or more precisely, the lining around the lung, called the pleura. If there is tenderness when pressing on the rib cage, that would strongly indicate that it is from inflammation of the rib cage. The pleura extends almost to the bottom edge of the rib cage, and pain from pleura inflammation can be felt anywhere along the rib cage.
Although it would require a proper evaluation to determine the exact cause, there are a couple options to try to ease this at home. The application of moist heat to the area of pain can help to relieve inflammation. You also can try to use an over the counter anti-inflammatory medicine, such as ibuprofen or naproxen. These medicines can help relieve inflammation of the rib cage or the pleura. However, these medicines also can irritate the stomach, so if you have a history of stomach problems, it may be better to avoid these medicines. In that situation acetaminophen can be used, although it is not truly an anti-inflammatory medicine.
If I can provide any additional information, please let me know.