You dont buy or sell a business.
You buy or sell either
Ownership position in a corporation is evidenced by Stock. It is like selling stock in a publically traded corporation. The business is not selling assets. The ownership of the business changed but not the assets nor the liabilities. The new owners just operate the business with the same federal identification number. Everything is the same but with new owners.
The above also applies to selling ownership interest in a non-disregarded entity (multiple member LLC or partnership).
Assets are sold. The business accounts for profit or loss based on the allocation of purchase price to the fair market value of the equipment, inventory, receivables, goodwill and non-compete (and maybe a few other things). Point is ASSETS were sold by the business. The ownership of the business did not change. The tax differences to the buyer and seller are different and often at odds. What is best for the seller may not be best for the buyer.
We often see new clients who sold a business. Once we discover the underlying facts we have often found a significant after tax difference based on what was actually sold.