my wifi on the iphone 3G is not working

the silent on/off switch when turned off, if you press the phone body on top left it keeps going on and off

the head phone jack has a problem that the mic does not work but the headphones work

anyone has a solution to this problem