Suppose that $M$ is a smooth manifold and $U \subseteq M$ is an open subset that is also an embedded submanifold of $M$. Let $S \subseteq M$ is an immersed submanifold of $M$ such that $U \cap S \neq \emptyset$. Is it in general $U \cap S \subseteq U$ is an embedded or immersed submanifold of $U$ ?
$\textbf{Edit :}$
I need this result to show that whether the restriction of a smooth function $\tau : U \to N$ (where $U \subseteq M$ is the open submanifold as above and $N$ is a smooth manifold) to the intersection $U \cap S \subseteq U$ can be smooth or not. If i can show that $U \cap S$ is an embedded or immersed submanifold of $U$, then i'm done.
$S$ is an immersed submanifold of $M$, i.e. there is a smooth manifold $E$ and an immersion $f\colon E\rightarrow M$ with $f(E)=S$. Then $E':=f^{-1}(U)\subset E$ is open. Now being an immersion is a local property, thus also $f\vert_{E'}\colon E'\rightarrow U\subset M$ is an immersion with image $S\cap U$. This shows that $S\cap U$ is an immersed submanifold of $U$.
In general there is no reason to assume that $S\cap U$ will be embedded (trivial counterexample: $U=M$).