now the profit, p(x) = revenue(r(x)) - cost for manufacture (c(x)) is a universal truth. If it's negative means it's just a lost and not profit.
The profit should be maximum when p'(x) = 0. As can be seen:

but, what if the function for r(x) and c(x) were such, even though it's highly impossible in real life the function exists;

Would this universal relationship not hold? What could the possible flaw in the logic be?