A "hub" is the most basic device for connecting two or more computers in a network. It is "unintelligent" and simply connects them together - traffic sent from one computer to another via a hub goes to all computers and they have to sort out what belongs to which computer.
A "switch" also connects multiple computers but is more "intelligent" in that it sorts the traffic so that it only goes to the correct computer in a network.
A "router" is a device for connecting multiple computers to the internet. Routers normally incorporate a network "switch" and, in the case of wireless routers, also a Wireless Access Point. ISPs only allocate one IP address, which is why only one computer can connect to their service. With a router, it is the router which connects to the internet, gets the single IP address and in turn allocates Local Area Network addresses to each computer connected to it. It then "routes" the internet traffic to the appropriate computer in the local network.