Is an open subset $U \subset \mathbf{R}^{n}$ diffeomorphic to the product $U' \times \mathbf{R}$ with $U' \subset \mathbf{R}^{n - 1}$ open?

I'm trying to prove that $U$ is diffeomorphic to the product of some open subset $U' \subset \mathbf{R}^{n}$ with $\mathbf{R}$, $U' \times \mathbf{R}$. I received the hint that this set admits a smooth function $f: U \to \mathbf{R}$ with no critical points but I'm not sure if the conclusion is true without some additional conditions on $f$ but I haven't been able to prove it.

Moreover I'm curious as to whether some manifold $M$ which admits a function $f:M \to \mathbf{R}$ with no critical points is diffeomorphic to some manifold $N \times \mathbf{R}$.

• Always make the body of your questions self contained. The question cannot be entirely contained in its title. – Mariano Suárez-Álvarez May 19 '16 at 5:36
• You edited the body but the question is still contained in the title! :-| – Mariano Suárez-Álvarez May 19 '16 at 5:48

The answer to your second question is positive if $f$ is proper. In that case $f$ is surjective. Fix a riemannian metric on $M$ and let $\operatorname{grad}f$ be the gradient of $f$ and let $X=\frac{\operatorname{grad}f}{\lVert\operatorname{grad}f\rVert}$. It is not difficul to show that $X$ is a complete vector field, that is, that its integral curves are defined all over $\mathbb R$. Let $\theta:\mathbb R\times M\to M$ the the flow of $X$.
Let $N=f^{-1}(0)$, which is a submanifold of $M$, and let $h:\mathbb R\times N\to M$ be the restriction of $\theta$ to $\mathbb R\times N$. One can show that $h$ is a diffeomorphism.
Notice that for any open set $U\subseteq\mathbb R^2$ the function $(x,y)\in U\mapsto x\in\mathbb R$ is free of critical points, so to find a counterexample in general you can look for a open set in the plane which is not a product. For example: take the open set $U$ which is an open neighborhoof the figure $8$. It it were the diffeomorphic to a product $N\times \mathbb R$, then $N$ would be connected, $1$-dimensional and it would have the homotopy type of an $8$: such a thing does not exist. This shows that some hypothesis on $f$ is needed.