Well, El Capitan is in beta test, so if you didn't install it, you're on Yosemite, or Mavericks. Either way, CMD-R boots to a recovery partition on the hard drive. It SHOULD connect to WiFi, but if not, you still should see the WiFi "fan" on the top bar and be able to click on it to get the WiFi status. Make sure it's turned on and that you have selected your network. From the recovery partition you can also run Disk Utility and repair (if possible) the main boot partition of the drive. You may not need to reinstall, but if you do, you can follow the prompts to format that partition and reinstall the OS that originally came with the machine. (Note: Doing that install will wipe out all of your own files, so I hope you have a backup.)