I would love to say that the answer is, yes, you can publish a book for free, but I would be telling a half-truth. Consider the time that you work on writing the book, and then editing the book. You will likely also spend time writing and re-writing a query letter to literary agents or to publishers.
That time is money. Although you do not need to spend money on your book, you will spend time on your book. This is my reason for saying that you can not publish a book for free. There is always a price to publishing a book. You can see it physically or you can not see it this way.
However, you can publish a book for free if you speak strictly of spending money.
1) Have a friend edit your book or re-read your book after you make edits. This is cost effective, but it might mean that some errors are overlooked. However, if editing is done correctly, then you can get your book out to publishers sooner.
2) Create an ebook: Simple and effective and often, if you understand some basic html, you can self-publish an e-book on Kindle for free; they offer this option. It also means that you can sell your ebook for less money, and you can earn a profit on your book sooner – but it does need to be sold, and marketed to the correct audience.
(As an example, my ebook is found on many of the Amazon websites, but the most common places people buy it from are amazon.com and amazon.co.uk)
3) Have a blog: A blog gives you a platform to get the word out about your writing, grow a fan base, and to write blog posts that make your readers want to come back and talk to you about both your blog and your book. You will have to think like a business, and make your blog “work” for you. Online businesses are like any other business. The difference is that a blog can be created for free, and you can promote your book on it.
4) Writing and creating online articles: If you write online, and you use one of the many writing sites out there, you have the chance to not only publish articles for free but some of them allow you to create drafts on these sites with the intent to sell your book to publishers who might be looking at your blogs and other online material.
There are many ways to publish a book for free, but the key to “free” is time and energy. If you spend too much of both, then it is not published for free.