Lots of people swear. Sometimes alcohol plays a part, other times it may be sports. Around my house, you're sure you hear it if any cable news station is on the television. Profanity creeps into daily life, like it or not, and that's why it also appears in books. How do you write it into yours, and should you warn your readers when you do?
Censorship and Warning Labels
In the American culture, profanity is still profane. Certain words are regulated, and surrounded by rules. You can only hear certain swear words on certain cable channels, while others are offered up regularly across all networks. You'll find profanity filters on forums and online video games, and you're sure to see at least one offended face if you cry out one of these "off-limits" words in a church. When certain words are considered to be taboo, writers have to tread very lightly indeed.
When is it okay to use profanity in your books? That depends entirely upon the genre. It's pretty much never okay to use a swear word in children's books -- even getting away with hell is pretty tough business. In YA a certain amount of swearing is tolerated and it's even to be expected, because teens often use profanity to express themselves (it's due in part to a lack of vocabulary and part to general teen rebellion). But in the YA world, you have to be careful about which swear words you use.
Swear words aren't just swear words...they exist in a hierarchy. Hell and damn are considered to be among the most mild of profanities, and they're even accepted on daytime TV. Shit is a little stickier (pun intended), and may be heard only after a certain hour on some cable stations. The "mother" of all swear words, known as "the f-word" is only featured on premium cable stations (and sometimes on Comedy Central when they're feeling frisky). The really racy words are probably best left out of YA, because they may irritate some parents. Since it's probably parents who are doing the bulk of household book-buying, it pays for authors not to offend them. However, gaining a reputation for writing a YA novel that parents hate because it's too obscene is sure to increase teen readership, so it's a bit of a win-in.
It doesn't work that way in other genres. If you're writing anything that's specifically geared toward a religious or spiritual audience, don't use profanity in any capacity. That's bound to anger some percentage of your target audience, so just avoid it entirely. It you're writing a light-hearted mystery or romance, seeing an "f-bomb" might be jarring to readers in that genre (who aren't often exposed to such in the mass-produced paperbacks of those genres). A gritty crime novel, horror novel or dramatic novel is expected to have a bit of a harder edge, so profanity may naturally come with the territory (and readers will be prepared for that). Sci-fi and fantasy works, which are often written to be read by people of all ages, don't often have a lot of profanity in them.
But at the end of the day, each author has to make their own choice when it comes to adding profanity. If it suits a certain character, you may feel that you've got to include it. Always stay true to your own instincts as an author where profanity is concerned, because you'll usually be right. If you're nervous about it, try running your book past a beta reader or two and see if they make any comments about your use of swear words. That will help you gauge how your intended audience might react.