Erm, no. Richard Castle is not real, per se. But we can see why there might be some confusion about this. Here goes:
This may be a bit repetitive, but stay with us: Richard Castle is the fictional protagonist of Castle. He's a very successful mystery writer who started shadowing NYPD detective Kate Beckett to help with his writer's block. She's become his muse (the character Nikki Heat is based on her), and two novels have sprung from their adventures together: Heat Wave and Naked Heat. The writing and publication of the books has been discussed on the show and has generated the appropriate amount of awkward tension between the characters.
Now here's where it gets weird/awesome. These books were actually published, as in, they're available on Amazon. They're also published under Richard Castle's name without crediting the real writer. Like, the “About the Author” section references Martha and Alexis. Yeah, it's serious.
And believe it or not, this gets weirder/awesomer. Both novels are New York Times bestsellers. Yeah, the real New York Times.
So, Richard Castle — still not a real person — is a bestselling author in the real world. And until we find out who the ghost writer is, we're all living in a literary grey area. Not to mention a reality grey area.