bad bulb.
The blinker (turn signal) interrupts the BRAKE light power to the bulb. if the bulb lights up with the head lights on that is a different filament in the same bulb.
cheap and easy to prove if it is the issue.
other answers are the turn signal switch, or the wiring to the bulb itself