How to get Wi-Fi away from home?

I have an iPhone 4G and my internet always works where there's Wi-Fi. But I have to have the Wi-Fi password. When I'm on the road or somewhere away from a home, building or anything like that, my phone says "AT&T 4G" and i don't have Wi-Fi or internet. I don't know how to fix this.

Contact AT&T if that is your service provider and check what data bundle they can offer you when not in a Wi-Fi area. Making use of 4G speeds when out and about.

1st off, there's no "iPhone 4G". Its called the iPhone 4.
2ndly, AT&T is just the carrier
3rdly 4G is internet access from AT&T

You can't get Wi-Fi out of range of its hotspot area.