I have derived the following first order condition
$$g(x,C'(x),..)=1,$$
where $x$ is the production level and $C(x)$ the cost of $x$, and $C'(x)$ is the first derivative of $C(x)$ (i.e. the marginal cost). By the implicit function theorem, we can derive how production changes with marginal cost:
$$\frac{\partial x}{\partial C'(x)}=-\frac{\partial g/\partial C'(x)}{\partial g/\partial x}$$
Where, the numerator on the RHS equals
$$\partial g/\partial C'(x)=\frac{\partial g/\partial x}{d C'(x)}$$
This then allows us to simplify the second equation
$$-\frac{\frac{\partial g/\partial x}{d C'(x)}}{\partial g/\partial x}=-\frac{1}{C''(x)}$$
And we then conclude that $\frac{\partial x}{\partial C'(x)}=-\frac{1}{C''(x)}$. This is clearly absurd, since with a concave cost function, the derivative of $x$ with respect to marginal cost will always be positive (i.e. production is increasing in marginal cost). What mistake did I make to derive something this absurd?
The step I think may be problematic is the third equation $$\partial g/\partial C'(x)=\frac{\partial g/\partial x}{d C'(x)}.$$ I asked about this elsewhere, and the step seemed fine to some.