An exercise of the book "Introduction to smooth manifolds - John M. Lee" asks to prove that if $S$ is a closed embedded submanifold of a manifold $M$, and $X$ is a vector field on $M$ tangent to $S$, then every integral curve of $X$ that intersect $S$ is contained in $S$.
Can someone show me a counteresample in the "closed-immersed" case?