This is purely an authoring (writing~writer's) question:
if the profanity serves a purpose (literary purpose), (just like nudity and~or sex, or graphic violence, too for that matter), then yes.
for example, having an individal character in your story using 'profanity', gives him 'character', makes him a special unique individual person, separate from the other characters. Same with giving a character different dialect and~or ways of talking. Also, if it's a historically accurate story, then you use (for example, Adventures of Tom and Huck Finn by Mark Twain, during the antebellum period in U.S history), using 'nigger', as that was the language at that time, for an african. Just as if you wrote a story of modern times, about gangs, you should have them using modern offensive slang as well towards the different ethniticies too. Lots of hateful ethnicity slang in modern times, towards europeans, asians, africans, arabs, hispanics~latinos, and etc (at least in the U.S., but hate is universally human, and so all other countries have their own offensive slang towards different ethnicities, I'm sure japanese in japan have their slang towards europeans, just as germans in germany have their slang towards french, and etc).
as to children, that's for the parent of the child to.... PARENT!!!!!!... the child !!!! if a child is mature~intelligent enough to understand that the profanity~nudity~sex~violence is for a (literary) purpose (understanding themes and etc advenced literacy english classroom stuff about story telling significance), then, there's no reason why the child can't.
I was was mature~intelligent already as a very young child, and was an avid reader, reading very grown-up books (my reading level has always been like +12 age-levels of my age and when I took classes in business law and logic and philosophy 101, I had an extremely easy time with them), which had lots of violence and sex and etc grown up topics (including advanced sophisticated topics of themes and sociology~human behaviorism, and etc), completely unbeknown to my parents, who had no idea what I was reading in those books, as they didn't care, as I was reading, and reading was a good thing to them (amusingly, the same attiude with my teachers, laughs. Someone would be whispering with a friend while the teacher would be teaching the class, and the teacher would snap at them to pay attention, and at the same time, I'd be engrossed in reading a book, and the teacher gave me a total pass, laughs. By reading, the teacher gave me reign over ignoring her lecture and instruction, laughs. I once read through nearly the entire class, without any discipline by the teacher. Though, why would the teachers care, as I was smart from reading so much, and I getting an A in the class anyways, despite my reading through the teacher's lectures each day).
Maturity is NOT nature, it is socially learned. A 5 year old child can be more disciplined and responsible and mature and grown up than a 30 year old. Psychologist's saying that our brain's and thus us, aren't mature until we're over 30 is scientifically-delusional insanity.
If you let a person be immature into their 30s, then you created their long-lived immaturity.
if you demand maturity~responsbility from even a young age, then you create what will be their early and long-lived maturity.
humans (like all animals~organisms) learn very quickly and very young, we immediately learn whether our society has high standards or no standards. If society demands maturity and excellence, then its people are mature and excellent from a very early age. if society is a total loser, then you got the modern world of immature 30 year old losers, who have no worth to society and life itself.
as right in Sun Tzu's Art of War itself, paraphrasing:
The emporer was sceptical that Sun Tzu could train lowly peasants into a professional army.
So, Sun Tzu proved him wrong, by challenging the emperor, that he can turn the emporer's carefree immature giggly playful concubines into disciplined soldiers. The emperor greatly laughed, knowing how impossible that was, so he accepted Sun Tzu's challenge. If Sun Tzu failed, he'd be executed for trying to con~fool the emperor, and if he succeeded (hah!), he'd be the emperor's commander of his army.
Sun Tzu picked a concubine to lead the other concubines into getting into a formation, and she giggled along with the other concubines, finding this all silly, and not taking it seriously.
in failing to command the other concubines to get into formation, Sun Tzu chopped off her head. The concubines' giggling ended in dead silence, as they watched the blood from her severed head and neck run across the palace floor.
Sun Tzu picked another concubine to do the same thing, and lo-and-behold, the concubine leader and her concubine followers, were instantly a professional army, they snapped into formation at the leader concubine's barking orders, not a single giggle, all with stoic faces of asolute seriousness. The emporer, immediately made Sun Tzu his Commander to raise an army of peasants for his army against the coming invaders to attack his kingdom.
Sun Tzu understands human~animal~organizism behaviorialism SCIENCE (thousands of years ago), maturity is LEARNED~TAUGHT (nurture) with age having no bearing at all, not biological (nature) brain-developed past age 30 as modern psychologists spout their non-science drivel. I wish Sun Tzu was still around, chopping off these modern scientifically-ignorant psychologist lunatics, sighs.