Chosen Solution
There is no available sound for the internal speakers nor microphone jack. The icon for sound when tapping the f11 or f12 keys has the slash for no sound unless the ubs adapter is plugged in.
To add a bit more to Fenando’s answer your jack has a set of switches as you can see here
So when the plug is inserted the internal speaker connection is dropped. In addition the digital output is enabled which is the source of the Red light coming from the jack. Sometimes the contacts get out of alignment or dirty which is what I suspect you are facing here. Update (11/03/2019) At this point I think you’ll need to pull the logic board out to inspect it for corrosion or other liquid damage around the DAC chip which is located on the back side of the logic board (marked RealTek) MacBook Pro 17" Unibody Logic Board Replacement. You might need a new logic board.
( 1 ) This old models have the optical audio inside of the audio jack, if is dirty will recognize a optical output. ( 2 ) If you are using a external audio adapter make sure that you are sending the audio to the right device on your settings. ( 3 ) Audio Card malfunction or Liquid Damage on the Logic Board.