I have a wireless router and I want to use it to connect to an existing public WiFi network for the purpose of using its Internet connection on my private network.
Is this possible?
You might be able to do it with your router by installing openwrt on it. You should first check their list of supported hardware
If your router is supported, follow the steps to install openwrt to it, and then set it up as a Routed Client
It's the same principle from kobaltz answer, except with much cheaper and less noisy hardware.
Assuming that this is not illegal where you're at and you have the consent from the hotspot owner:
This is possible, but you would most likely need another device to act as your gateway. You would need to have a computer with both a Ethernet and WiFi adapter. You would need to connect to the wireless network using the WiFi adapter and then connect the Ethernet to your Router. From here, you can bridge the WiFi and Ethernet adapter to allow ICS (Internet Connection Sharing). You can have users connect via your router and then it would tunnel through your Gateway and connect to the internet through the hotspot.
However, this may be illegal where you're at, especially if the Hotspot owner does not know that you're doing this (research bandwidth highjacking).
Also, if the hotspot has a proxy in which you must first accept their terms prior to using their connection, then you may be out of luck unless if you write a script on your gateway to monitor this periodically and then accept the terms. However, again this could be illegal.