There is nothing in the IPv4 header that enables you to identify duplicates. A packet is a duplicate when it matches a previous packet in entirety, header (apart from TTL and checksum) and payload, and the source has only send one such packet.
As @manishma has pointed out, you would need to hash each packet, store the hashes for a certain time and check for matches between them. If there's in-path fragmentation you'd even need to reassemble fragments before hashing. Of course, packets with very low TTL values are a clear warning sign.
A routing loop is most easily detected by using traceroute-type probes - a series of packets with TTL increasing from 0 - and then analyzing the sources of the ICMP _time exceeded_ messages.