Try connecting the laptop directly to the router using an Ethernet cable for a faster & more reliable connection.
It is possible the hard drive is failing so it is unable to download the installer to the laptop's hard drive. Do you have a USB drive large enough that you can attempt to install macOS from Recovery Mode? Do you still have your original OSX installer DVD which shipped with the computer? You can run the Apple Hardware Test. I can provide instructions for creating a bootable Linux USB drive to check the health of the hard drive if you want.
If your Mac cannot boot to the internal drive, then you will need access to another Mac to create the bootable macOS USB installer.
If so, then download the macOS 10.11 El Capitan installer from here (available outside of the App Store):
https://support.apple.com/kb/HT206886
Create a bootable macOS USB installer using these instructions:
https://support.apple.com/en-us/HT201372