Public service fraud investigator wrote helpful guide, found himself in court