How can I opt out of Apple diagnostics / Carrier IQ on the iPhone?
First off, Apple has issued a statement regarding the controversial Carrier IQ software. iOS 5 devices do not run the Carrier IQ software package (IQRD) and Apple will be completely removing all references to the software in a future update. Even without Carrier IQ, the iPhone can still send diagnostic and usage data to Apple daily to help Apple improve its products.

All data sent to Apple is anonymous and encrypted. Still, if you wish to opt out of this feature, iOS 5 has an easy way to make sure your device is not sending this data to Apple's servers:
1. Navigate to Settings -> General -> About -> Diagnostics & Usage
2. Make sure the box marked Don't Send is checked