A hub is the most basic device for connecting two or more computers in a Local Area Network. Traffic sent from one computer to another goes to the hub which sends it to all networked computers and lets them sort out which packets belong to which computer.
A switch is more sophisticated in that it sorts the traffic so that each computer only receives packets intended for it.
A router is a device which connects to an ISP and "routes" the traffic to the appropriate computers in the Local Area Network. The router gets the single IP address allocated by the ISP and, in turn, allocates LAN IP addresses to the networked computers by DHCP. Although there are single port routers, they normally incorporate a 4-port network switch. Wireless routers additionally incorporate a Wireless Access Point.