When we consider a perfectly competitive market, in the short run we will run a firm if the total economic profit though negative till price is above shutdown point.In long run we will run at an equilibrium where total economic profit is 0. I am not able to understand why would we run a firm if the profits are negative or 0 ?
This is because we are talking about economic profit not accounting profit.
An economic profit takes into account opportunity cost. If you are skilled programmer that can earn $\\\$100000$ per year being employed at Google then doing something else like operating your own business incurs an opportunity cost of $\\\$100000$ per year.
Hence in this situation if the person would set up perfectly competitive business, the business would still record $\\\$100000$ accounting profit even if the economic profit would be 0.
Consequently, even in perfectly competitive business people have actual incentives to run those business.
To elaborate a bit on the answer by user 1muflon1, in economics the word "profit" is the surplus accrued to the firm after we have subtracted from revenues all compensation of production inputs, irrespective of whether these compensations have been recorded by Accounting as expenses or not. Two examples:
Suppose you run your own business, and you work in this business. You do not officially give yourself a wage, so your Accounting Dpt cannot and will not charge an expense for the compensation of your labor/skills as an input to production. It follows that the accounting profits will include also your compensation as a worker. In order to arrive at profits in the Economics sense of the word, you should subtract from the Accounting profits some "average" compensation that you should receive based on your skills, duties etc in the business.
Suppose also that you have invested in this business some amount of money with which you bought some equipment for the operations of the firm. For this capital the Accounting Dpt will subtract from revenues only the Depreciation, but not any net compensation. So in the Accounting Profits figure, the net reward to capital is included, which must be subtracted in order to arrive at the Economic Profits figure. This reward could be approximated as some "average", "normal", "usual" net return to capital that holds for the industry you operate, the country, the era...
...and these "average" inferred compensations are essentially estimates of the "average" opportunity cost user 1muflon1 is talking about.
Is the economics approach to profits some twisted useless thing? No, on the contrary. It gives us a way to evaluate whether having this business is worth the trouble. If we have Accounting profits, but Economic losses, it means that the Accounting profits do not even cover the wage we should be receiving for our time and skills spent there, and/or the returns we should be receiving for our capital invested. In other words, in such a case we bear the entrepreneurial risk without any actual reward, because the income we earn is below what we should receive as production inputs, let alone as business owners.
Investopedia has this definition:
Economic profit = revenues - explicit costs - opportunity costs
where opportunity costs must be either zero or positive based on management evaluation of at least one counter-factual scenario.
This article argues that opportunity costs are zero or positive and cannot be negative because logically a negative cost would be a benefit not a cost:
So opportunity costs are always positive. Then if one assumes perfect competition there are only two options. Option 1: enter the perfect market with expectation of earning either zero or negative long term profit. Option 2: do not enter the perfect market.
One should conclude that motives to enter a perfect market are not profit motives. Profit motives should make competition in perfect markets into an opportunity cost or the cost of not participating in markets with pricing power.
One may also recognize that firms in industries with profits have pricing power, that is, these firms have the ability to keep costs below revenue. Pricing power violates the assumption of perfect markets. Also creditors should prefer to lend to borrowers with pricing power and/or marketable collateral.