Choice "D" is correct. Firms produce up to the point where marginal cost equals marginal revenue, whether the markets are perfectly competitive or imperfectly competitive.
Choice "b" is incorrect. The relevant comparison to marginal cost is marginal revenue, not price. It is assumed that revenue is not fixed on a unit basis.
Choice "a" is incorrect. Beyond the point of average costs being minimized, marginal cost will rise. Still, it will make sense to increase production until marginal cost equals marginal revenue.
Choice "c" is incorrect. Marginal revenue, not price, as revenue is assumed to vary on a per unit basis, and not average cost, since it will increase profits to expand production until marginal revenue equals marginal cost.