What you’re seeing points very strongly to a failed or failing internal hard drive. The flashing folder with a question mark means the Mac can’t find a valid system to boot from. The globe with an exclamation mark and error -4500F confirms that Internet Recovery is also failing—usually due to either network compatibility issues or a disk that can’t be initialized at all. This behavior is extremely common on this generation of iMacs with original mechanical drives.
First, I pretty much agree with the others that have replied to you. However, there are a few things you can try (some have already been mentioned) to either revive it, or at least, confirm the diagnosis. The goal is to determine whether the logic board is healthy and whether the drive is recoverable.
- Reset NVRAM. Ref: Reset NVRAM on your Mac - Apple Support
- Try Internet Recovery on a wired network
- Plug directly into your router via Ethernet
- Power on and hold Option + Command + R
- If the globe appears again with -4500F, move on
- The next step would be to boot to Recovery mode, and then, use the Disk Utility to check the Mac's internal drive, but since you were unsuccessful in accessing this mode, you can just skip this step ... however, it still may be worth a try.
- Test with an external boot drive. (This was mentioned by others). If the iMac boots successfully from the external drive, the internal drive is 100% the problem.
A suggestion on how you may still be able to use this Mac until you can get a replacement:
If the external boot works, you can run the iMac entirely from an external SSD. This avoids opening the iMac and is fast, stable, and inexpensive.
Note: If you need data from the internal drive and it still shows up intermittently, recovery software might help—but if it’s invisible in Disk Utility, it’s beyond DIY recovery. So, if any of that data is critical to you, you will have to solicit help from a professional recovery service (unfortunately, at a cost close to a new computer).