You wouldn't use a router to connect to the internet.
If you have free wi-fi, then you would just add that to whatever computer has access. You would need to know the NAME which should appear as one of the local wi-fi connections and if it's secure (which it should be) you'll need the password as well.
1. Start computer
2. Click on network connection and "add wireless network"
3. Choose the proper name "Apartment network name" for the shared wi-fi network, and
4. Use password if needed
You'd then be connected to the INTERNET through the apartment's modem. (It's like accessing a Starbuck's network)
A router can connect different devices on a local network if you need to transfer files between them but otherwise it serves no purpose in your case.