converse of theorema egregium Suppose $(M,g)$ is a $3$ dimensional Riemannian manifold and $N$ is any surface imbedded in $M$. If the theorema egregium holds for $N$ does it follow that $M$ is flat? The way I'm thinking of the theorema is that everywhere on $N$, the scalar curvature equals twice the Gaussian curvature $$S=2K.$$
 A: This question remains confusingly stated. I agree with @studiosus that the intent of the question is to ask this: If the intrinsic Gaussian curvature of $N$ is equal to the extrinsic Gaussian curvature of $N$ (at every point), then must the ambient manifold be flat, i.e., a Riemannian manifold of constant sectional curvature $0$? The answer is that this suffices.  
This follows immediately from the Gauss equations for a submanifold (which you can find in Kobayashi-Nomizu, Spivak, doCarmo, etc.). Basically they say that the sectional curvature of $N$ is the sum of the determinant of the second fundamental form and the sectional curvature of $M$ for the tangent $2$-plane of $N$. If $M$ is flat, we're obviously done. But need it be? No. For example, let $M = \Sigma\times\Bbb R$ for any Riemannian surface $\Sigma$, and let $N = \Gamma\times\Bbb R\subset M$ for any curve $\Gamma\subset\Sigma$. The cylinder $N$ is intrinsically flat, its extrinsic Gaussian curvature is also $0$, but $M$ is clearly not flat (e.g., take $\Sigma$ to be the usual $S^2$).
If we know that the result holds for arbitrary surfaces $N$, then, of course, $M$ must be flat, as the sectional curvatures of arbitrary $2$-planes must then all be $0$. 
