Have a look in your headphone socket, there may be some debris down there that's preventing the speaker from switching on when the headphones are disconnected. If you see something try to suck it out with a vacuum cleaner and small nozzle. If you see nothing untoward s in the headphone socket, you may have a hardware problem and a visit to the Apple store may be warranted.