I want to download the latest iOS version for offline restore for my iPhone 4. I want to know what is the latest iOS version and how can I download it?
The latest iOS available for the iPhone 4 is iOS 7.1.2
Have a look at: Maximum Supported iOS Version
The direct download links for the full releases are:
Download the appropriate file for your device and then in iTunes select the device and option-click the Check for Update button and select the downloaded .ipsw file.
Also, if you Google "how to install ios from file using itunes" (without quotes) you'll find additional information.
The iPhone 4 is the most recent iPhone to be discontinued from the iOS Update cycle. It did not receive the iOS 8 update, so it's final software version is
iOS 7.1.2. You can update to this version through iTunes, or download it from an IPSW repository like this website: https://ipsw.me/