Not really. Under the given conditions, the implicit function theorem guarantees that the expression f(p)=f(p_1,p_2)=0 defines a function y=y(x), x\in (p_1-\epsilon, p_1+\epsilon)=I (or x=x(y), but choose the former for convenience) . So an extremum for g on f^{-1}(0) is in fact the extremum of...