Zero-profit condition
In economic competition theory, the zero-profit condition is the condition that occurs when an industry or type of business has an extremely low (near-zero) cost of entry to or exit from the industry. In this situation, some firms not already in the industry tend to join the industry if they calculate that they will make a positive economic profit (profit in excess of the cost of acquiring investible funds). More and more firms will enter until the economic profit per firm has been driven down to zero by competition. Conversely, if firms are making negative economic profit, enough firms will exit the industry until economic profit per firm has risen to zero. This description represents a situation of almost perfect competition. The situation with zero economic profit is referred to as the industry's long run. According to the theory of contestable markets, if few enough firms are in the industry so that one would expect positive economic profits, the prospect of other firms entering the market may cause firms in the industry to set prices as if those other firms were already in the market; thus actual entry by those firms is not necessary for the market to appear perfectly competitive. Algebraic proof 
The relevant variables are  p, w, x, and f(x). p is the price of the output, w is the price of the input, f(x) is the amount of output, and x is the amount of input. Thus, the profit-function can be written as the following:

(p, w) = maximize((p • f(x)) - (w • x))

Let us consider a case where profits are strictly positive and as we increase inputs by a factor of a constant, y, we get increasing profits. y is greater than 1. This can be modeled using our profit function from before below where k is our initial profit:

Initially: (p • f(x)) - (w • x) = k and k>0

When we increase inputs by a factor of y: (p • f(y • x)) - (w • (y • x)) = (y • k) > k

We can see that when we increase inputs by a factor of y, we obtain increased profits. Thus, as we consistently increase the firm's inputs, the firm's profits also consistently go up and there is no limit at which the firm's profits start decreasing. In a perfectly competitive market, there are minimal to no barriers to entry. Thus, prospective firms, seeing that there is a profit to be made, will start entering the market, which would then decrease the current profit per firm because there is only a limit to demand. Consequently, this keeps happening until there is zero profit per firm in the market. When this happens, firms will not have incentive to enter the market making zero profit the equilibrium point in this market. This can also be illustrated in the opposite way. Let us consider a case where there are too many firms in the market, causing a negative profit. A negative profit would mean that firms would start to leave the market. As firms leave, there is more profit per firm. This gradually increases to an amount of 0 profit per firm, where firms do not have incentive to leave the market or join the market. Examples

Historically, this condition was present in most gold rushes, as diggings required nothing but manpower and few skills or machinery. It has been noted in such circumstances, that the ancillary services supplying the activity become very successful. For example, few gold prospectors became wealthy, but many formed successful businesses selling shovels. For another example, despite the real estate boom of the mid-2000s, the incomes of real estate agents did not rise significantly. It is easy to become an agent, so when profits start to rise, more people do become agents, and the existing agents start to sell fewer houses. See also
 Barriers to entry
 Competition

References

Profit