No sound coming from speakers on iphone 4?

I have an iphone 4 (unlocked for the sim card, 8 gb) that has no sound coming from the speakers, the volume bar doesn't show up either when I'm watching a vid or listening to music. I can hear it just fine with headphones but the speakers on the phone sometimes will work (the volume bar will also appear) but only for a couple of seconds then it will cut off again, like it's stuck on dock mode or something. I took it to a buddy who fixes them and he said it was probably the speaker. Tried with a new speaker and didn't work, still the same as before. He said it was probably a motherboard issue, could I just buy a new/used motherboard and have him change it out without any problems?

Well, maybe you should go refund it at an apple store near by, and for sure they will check it out for you if it is a real iphone 4. Or just your phone is glitched!

A motherboard would be more than the iphone.
its probably stuck in headphone mode.
keep inserting headphones in and out until it pops out of the mode.