For few wks, severe pain behind right ear, swollen lymph nodes in neck, severe fatigue. Yesterday, sharp pain started under left rib. What could it be?

Unclear. A tender lymph node and fatigue may suggest mononucleosis, but that is only one possibility; pain under the left rib cage may be related to spleen which is not inconsistent with mono. But, mono needs to be proven and if negative other causes need to be evaluated. Isolated lymph nodes are not usually a problem but occasionally are. Investigation should be able to differentiate.