How to solve Bertrand Equilibrium with a non-constant MC?
The main issue seems to be that you assume that under Bertrand competition a firm is free to set a price and a quantity as well. But under Bertrand competition firms set prices and then have to meet the demand whatever level it takes. Below is a detailed discussion.



I will assume that cost functions are the same for all firms and also that the marginal cost function is non-decreasing. (You do not explicitly state these conditions but seem to assume them as well.) I will also assume that demand is non-increasing in price.

In this case, your candidate for the equilibrium is when all firms set the price $p^*$, where all firms produce
$$
q^* = \frac{D(p^*)}{5}
$$
and where
$$
p^* = MC(q^*).
$$
Is this really an equilibrium, or could a firm profit by deviating to a slightly lower price $p'$?

If say firm 1 were to deviate to $p' &lt; p^*$ while the other firms still charge $p^*$ then all consumers would seek out firm 1. Since $p' &lt; p^*$ and demand is non-increasing in price
$$
D(p') &gt; D(p^*).
$$
Firm 1 has to fulfill this alone, so
$$
q_1 = D(p') &gt; D(p^*) = 5 \cdot q^*.
$$
Because marginal cost is non-decreasing you also have
$$
MC(q_1) &gt; MC(q^*).
$$
So now firm one charges a price lower than $p^* = MC(q^*)$ but it has to produce so much that the marginal cost is larger than $p^*$, hence it earns negative profits, hence deviation from $p^*$ was not profitable.