I have an extremely bad cough and I cough until I burp, I'm coughing up air bubbles I think. Someone I know had given it to me, is this a virus?

Chronic cough. Sometimes a cough can persist after viral upper respiratory tract infection for a few weeks. Antibiotics often do not play a role in therapy. For persistent cough one needs to consider acid reflux which has its own therapy.
The cough may be. The cough may be caused by a virus or bacteria or less likely asthma. At the end of coughing you take in air and some of that air goes down your esophagus to your stomach. After enough coughing air accumulates in your stomach and then just rises as a bubble or several bubbles up and out from where it first came.