A good friend of mine, also a writer, challenged me with that very question a while ago. She had had an agent for one of her novels, but the project dead-ended with him. She'd sent out many, many short stories to literary magazines, only to reap rejections. She'd been published as a poet, but decades ago. She was discouraged, and rightfully so. "What point is there," she asked, "in writing, if no one is going to read your work? Isn't the point of writing to be read?"
I tried to argue the art-for-art's sake point, that writing is a worthy pursuit in and of itself, even if your words never get published. And I certainly believe this; writing helps me sort my thoughts, helps me make sense of the world. It was, however, a lame argument for me to make because at that point I had already been published many times. Of course my friend's response was, "Easy for you to say."
But then it occurred to me that as a memoir writer, I have the additional benefit that my story will at least matter to my family. So I said to my friend, "I don't know if my book will ever get published, but you know what, writing it is worth it for my family. At least my children will have my version of my story."
My friend, who has now moved on to writing plays and has had two read for stage already, retorted, "You memoir writers are privileged that way."
Where are you at with this? Would you continue to write even if you had a crystal ball that told you you'd never get published?