Things to try ... Reset PRAM, SMC, Verify disk, turn it off and on again, install OS X to external hard-drive and boot into that -- (useful for diagnostics) -- does the wifi work there?
Also, is it just not connecting or doesn't detect anything? Or is there an error?