Let $f: M \to N$ be an immersion of a differentiable manifold $M$ into a Riemannian manifold $N$. Assume that $M$ has the Riemannian metric induced by $f$. Let $p \in M$ and let $U \subset М$ be a neighborhood of $p$ such that $f(U) \subset N$ is a submanifold of $M$. Further, suppose that $X, Y$ are differentiable vector fields on $f(U)$ which extend to differentiable vector fields $X^*, Y^*$ on an open set of $N$. Define $$(\nabla_x Y)(p) =\text{ tangential component of }(\overline{\nabla}_{x^*} Y^*)(p),$$ where $\overline{\nabla}$ is the Riemannian connection of $N$. Prove that $\nabla$ is the Riemannian connection of $M$.
For the bounty: I need a detailed explanation of the proof that the connection is compatible with the metric. [this will be removed as soon as the bounty expires]