Welcome to Android Central! There might be something stuck in the headphone jack, or the jack might be faulty. Use a toothpick to root around in the jack to see if anything is stuck in there. If a piece of metal (like the tip of a headphone plug) broke off in there, it could make the phone think that headphones are constantly plugged in.