I'm off to bed, but just some quick comments:
WiFi has a limited range - usually - and essentially you need to be pretty close to the base station to use it ("pretty close" often essentially means "in the same house", for example - it all depends on how much material and distance is between your computer and the base station). You would connect the AirPort base station to your cable modem (or, more likely, to a router which plugs into your cable modem and acts, essentially, like a power strip does for electrical outlets - it lets you plug more than one ethernet cable into it). Then you'd be able to get online from your iMac via the AirPort base station - just like how your cordless phone has a base that plugs into the phone line, then you remotely access that line via the phone headset.
it is possible that you could find other WiFi signals, depending on what equipment is nearby, but it's hardly a "given" and most of them are likely to be secured anyway, so you wouldn't just be able to "hop on". However, there are growing numbers of businesses that offer free WiFi, so there are areas you can get on for free.
As to why you can't browse even though you're connected... I'll leave that to someone far more awake than I am.
Best of luck!
Edit: You don't need to buy an AirPort base station. Your cheapest bet is to buy something like a Linksys WRT54G, which is a router (lets you plug in more than one wired computer) and a wireless base station in one piece, and it costs ~$60 or so. Much cheaper than any AirPort, and pretty easy to set up. Otherwise, if you buy an AirPort, you'll either need to get a separate router (assuming you have other computers to plug in, because otherwise the AirPort would plug into the only ethernet port on your cable modem, but, with a router, you'd plug that into the modem, then plug the AirPort into it) or cough up the $$$ for the AirPort Extreme, which is much more than the AirPort Express but does come with its own ethernet port (i.e., you plug the Extreme into the cable modem and your other computer into the Extreme).
Also, one problem you might be having, depending on your service provider and assuming you had a PC connected previously to the cable modem, is that some companies force you to tell them every time you connect a different computer to their modem. In that case, your best bet is to buy a router (like the Linksys WRT54G), connect that to the modem, then call your service provider and provide them the MAC address ("MAC" = sort of a serial number for any network device, like computers and routers, as opposed to "Mac", which you're using) of the router. Anything you plug into that router would then work just fine. So, my guess is that your service provider has the MAC address of your PC, but, now that you've plugged in the Mac, which has a different MAC address (they're all unique), you cannot connect. If that's the case, your problem isn't that you're using a Mac, it's that you're using any computer onther than the exact one you had plugged in before.