For those who are self-employed and periodically work at a library or cafe, because formal co-work spaces don't exist in your area, do you deduct the mileage to/from these locations?
It depends. IRS Publication 463 describes the details. It says:
Daily transportation expenses you incur while traveling from home to one or more regular places of business are generally nondeductible commuting expenses. However, there may be exceptions to this general rule.
You should read over the descriptions of various scenarios. The overall gist seems to be that, the more a given location becomes your "default" work location, the less likely it is that you'd be able to deduct transportation costs to get there. For instance, if you were employed at an ordinary office job, you wouldn't be able to deduct transportation costs for your commute; if you treat the library as effectively your office, you probably can't deduct the costs for the same reason. If on the other hand you have "no regular place of work", then:
You can’t deduct daily transportation costs between your home and temporary work sites within your metropolitan area. These are nondeductible commuting expenses.
There is the possibility to get a deduction if you have a home office:
If you have an office in your home that qualifies as a principal place of business, you can deduct your daily transportation costs between your home and another work location in the same trade or business.
Personally I would be reluctant to claim any meaningful deductions in these areas without getting professional tax advice. I also am self-employed and work in various locations, and a few years ago I looked into the possibility of taking these deductions. I ultimately decided not to do it because the hassle of documenting the expenses, and the potential risk of even more hassle if they trigger an audit, did not justify the effort because the amount of deduction was so small. My hunch is that it's not worth it to bother with these deductions unless you're spending a significant amount of money on these transportation costs.
I just checked the IRS website for business travel expenses - https://www.irs.gov/taxtopics/tc511
A clear statement is you cannot deduct if you travel within your "tax home". Tax home refers to the city or area where you work.
Tax deductions are allowed only if you travel away from your tax home that too for a substantial period of time (not traveling back and forth in a day).