Let $M$ be a smooth manifold of dimension $n$. Let $U \subset M$ be an open subset such that the restriction $TM|_U$ is trivial. Let $N$ be a closed submanifold of $M$ contained inside $U$. Does it follow then that $TM|_N$ is trivial as well?
I thought this was a trivial result (simply take $n$ linearly independent sections over $U$ and restrict to $N$), until I played around with Stiefel-Whitney classes and got a contradictory answer.
In particular take $N$ to have codimension $1$, and $N$ and $M$ to be orientable. Let $N$ be not parallelizable. Then $TM|_N \cong TN \oplus \nu$ where $\nu$ is the normal bundle of $N$ inside $M$, and $\oplus$ denotes the Whitney sum. It can be shown that since $\nu$ is a line bundle and $N$ and $M$ are orientable, $\nu$ is trivial. Hence $w_i (TM|_N) = w_i (TN \oplus \nu) = w_i(TN)$.
But $TN$ is not trivial, so not all $w_i$ are zero for $i>0$ so $TM|_N$ cannot be trivial, a contradiction.
Clearly I made a mistake somewhere, either at the beginning with the $n$ sections or when working with the Stiefel-Whitney classes, but I can't spot it. Any help in pointing out my mistake would be appreciated.
EDIT: Correction from the discussion in the comments, in the second part, $N$ should have some nonzero Stiefel-Whitney class instead of being just not parallelizable. In this case, there cannot be such an open set $U$ containing it.
The first argument is correct. In addition to the discussion in the comments, a nice example to think about explicitly here is the usual codimension-$1$ embedding of $N = S^2$ into $M = \mathbb{R}^3$. They're both orientable, $N$ is not parallelizable, the normal bundle is trivial, $TM$ is trivial (so we can take $U$ to be, say, a sufficiently large open ball containing $N$, or just all of $M$), and so the pullback of $TM$ to $N$ is also trivial.
This embedding shows that the tangent bundle $TS^2$ is stably trivial (it is trivializable after adding a trivial line; the same is true for every sphere, using the embedding $S^n \hookrightarrow \mathbb{R}^{n+1}$), and in particular all of its Stiefel-Whitney classes vanish. But $TS^2$ is not trivial (by the hairy ball theorem; in terms of characteristic classes, its Euler class does not vanish, and the same is true for every even-dimensional sphere).