If that was really true then anti-discrimination laws would be unnecessary, or almost so.
In terms of US history, it gets more complicated because of the conflict between local and federal government. Federal anti-discrimination laws effectively trumped local discriminatory laws.
Furthermore, we don't
have fully free markets in many sectors of the economy, and the public doesn't seem to really want one. As I mentioned before, laws that constraint the free market for some other intended purposes can still create situations in which undesirable discrimination becomes cost-free. If we want to keep those laws because of their other intended purposes, then anti-discrimination laws can obviously serve a use in preventing discrimination.
Say I open a restaurant in some fictional place chock full of racists. 95% of the people are of race A, and 5% are of race B. I realize that my customer pool becomes too small to service only race B. I'll never have enough customers. But I'm not racist, so instead of only serving people of race A, I put a big sign on the front that says "everyone welcome". Well now I'm boycotted by everyone of race A. I realize that financially speaking, I'm better off just conducting business with race A. And that's excluding threats of violence or damage to my business.
Unless this place is very small, then you've missed out on some very important aspects of your scenario. Most towns don't have only one restaurant, which means that multiple restaurants will need to compete with each other. If 20 restaurants all compete for the business of race A, then they're each going to get a little less than 5% of the total population. A new restaurant would do better to gain a monopoly on that unserved population B than to compete for a small fraction of population A.
Furthermore, this hypothetical isn't really representative of anywhere in the US anymore. More realistically, the number of people who would refuse to eat at a restaurant that served racial minorities is itself going to be a minority, and likely smaller than the number of people who would refuse to eat at a restaurant that refused to serve racial minorities. So restaurants that cater to them have access to a smaller market, and those customers themselves have access to fewer restaurants, and would likely pay higher prices for less selection. In a realistic scenario in this country, those customers would be hurting themselves with their discrimination. What's more likely to happen now even in the absence of antidiscrimination laws is that almost all restaurants serve everybody, and the racists will end up eating at the same restaurants as the minorities even though they don't like them.
See above. They didn't want to scare away business from the majority, who had more money to spend anyways. They also didn't want their place of business burned down.
Unless the government fails to enforce the laws (which brings us back to what happens when government is actively part of the problem), then that's not really a concern.
Also add that some of the business owners were themselves racists (to the point of not caring if they could make more money by serving everyone regardless of color).
The owners who don't care about making more money will lose out to the owners who do.