In many cases you can draw up specs or right out your idea or book or whatever it is and mail it to yourself in a well sealed envelope or mailer the postmark will designate when you originated the idea. It is an inexpensive and not airtight but a very good marker to a definitive date in which you conceived the idea. It must be sealed very very well however. That and you can have the idea notorized by a notary then sealed this will also help the case. But if it is an idea currently out there before you can do any of this your pretty much screwed.
The safe bet, is If you come up with a Idea, You first need to make a "dated" detailed diagram of how it functions, a fact sheet of your invention outlining detailing purposed functions. Then have it witnessed and notarized and mailed to you certified through the USPS and don't open it. That protects you when you came up with your idea. You will still have to register it.
First four answers are myths. No one can copyright or patent an idea. Everything you write and publish is immediately copyrighted by you, and that means everything you've ever posted online because posting online = publication, which is why you'll also get a boot across your neck if you post the entirety of an already published article even if you give ample attribution.
There are websites which require you to agree to their Terms of Agreement which contains language stating that by agreeing, you sign away your copyright rights to what you write in perpetuity, so it's important to read what you click to agree on before you agree to it.
A couple previous answers are confusing patent with copyright. They are separate things. The mailing of something to one's self has no legal standing.