Can you get charged for writing a book about a crime you committed?
Yes, if the crimes were committed recently enough that they are still within the statute of limitations (time within which charges must be brought)--which varies by crime, so we can't offer any guidance about how long that would be, without knowing what the crimes are--you be charged due to the book. The book would simultaneously be a confession and also point the authorities in the right direction for an investigation.