How would you know if your iPhone is 2G or 3G?

You can check it this way: If you go into the Settings menu, and further into the General menu and press Network. In there there should be a option saying "Enable 3G". If you got that on your iPhone, then it's a 3G :o)