Various possibilities are there for these kind of symptoms. Sharp pain under the right rib cage points to gallbladder disease. Types of gallbladder disease include gallstones and inflammation of the gallbladder.Liver disorder may cause such kind of pain. Liver function tests as well as an abdominal ultrasound would be a reasonable approach to investigate this.
Second possibility is of costochondritis (an inflammation of the junctions where the upper ribs join with the cartilage that holds them to the breastbone or sternum.)
Third possibility is of gastresophageal reflux disease or hiatal hernia or peptic ulcers.You need upper GI endoscopy to diagnose it.
Fouth possibility is of underlying lung pathology which is pressing upon the diaphragm and causing pain.CT chest may be needed.
Lastly,an important cause of such pain is ovarian cysts causing referred pain under the ribs.
It would be better to get CT abdomen done which can clear cut confirm a diagnosis from the above possibilities.Pls consult a gastroenterologist and get CT abdomen done.
Hope it helps.Take care and pls do keep me posted on how you are doing.