I purchased an iPhone 3G last Friday, and I already had to reboot it 5 times over the week-end as it device does not support switching from horizontal to vertical display or the other way around. After rebooting it works fine till the next waking up from a sleep mode...A topic about this issue is receiving numerous visits on Apple discussion forum. If it affects mostly iPhone 3G, the problem also impact iPhone v1.0 which have been updated with firmware 2.0. So, the accelerometer is might not be defective, but rather a bug in the iPhone OS Firmware 2.0.
In USA, Apple will exchange devices experiencing such issues, something easy when considering the number of opened Apple Store.
Unlike the iPhone v1, the 3G model is covered by an international warranty valid in all countries where the iPhone 3G is officially available. One will have to provide couple of proofs that you obtained such device legally and from authorized resellers, as described in the
iphone_Warranty.pdf
