The primary key issue with slave
Duplicate key error should never happen.  When it does, then probably


The Master and Slave were not in sync (perhaps for a long time)
You are writing to the Slave.


Never write to a Slave.  Recommend setting readonly=ON on the Slave.  This will (mostly) prevent accidental writes.  However, user 'root' (or any SUPER user) will bypass the readonly check.

As Aaron mentioned, percona.com has a tool for checking consistency between Master and Slave.  They have another tool for syncing them.