Manifold with injective continuous map into $\mathbb R^k$ admits embedding into $\mathbb R^{k+1}$ This is Problem 4-34 from John Lee's book Introduction to Topological Manifolds:

Suppose $M$ is an $n$-manifold that admits an injective continuous map
  into $\mathbb R^k$ for some $k$. Show that $M$ admits a proper
  embedding into $\mathbb R^{k+1}$. [Hint: use an exhaustion function]

My first thought was to let $f:M\to\mathbb R^k$ be the injective continuous map and let $g:M\to\mathbb R$ be an exhaustion function, then to map $x$ to $(f(x),g(x))$, but this isn't a homeomorphism. 
In the book, it is proved that every compact manifold is homeomorphic to a subset of Euclidean space. Because of this, I was thinking that, since $g^{-1}((-\infty,c])$ is compact for every $c$, maybe I could consider for each $c$ a homeomorphism $h_c:g^{-1}((-\infty,c])\to\mathbb R^{k_c}$. However, I wasn't able to show that this leads to a proper embedding into $\mathbb R^{k+1}$.
I guess I'm not quite sure where to start with this since I'm not very familiar with how to use exhaustion functions/why they are useful. Also, I don't know anything about immersions or smooth manifolds, so I wasn't able to understand the stuff that I found online (which talked about the Whitney immersion theorem).
Thanks!
 A: This community wiki solution is intended to clear the question from the unanswered queue.
Moishe Kohan has answered your question in his comment. However, let us first note that an injective continuous map $f : M \to \mathbb R^k$ is not necessarily an embedding (i.e. a homeomorphism onto $f(M)$). As an example take $f : M = (-1,2\pi) \to \mathbb R^2, f(x) = (\cos x,\sin x)$ for $x \ge 0$ and $f(x) = (1,-x)$ for $x \le 0$. The set $C = [\pi,2\pi)$ is closed in $M$, but $f(C)$ is not closed in $f(M)$. This is a phenomenon which is possible only for non-compact $M$. In fact, if $M$ is compact, then $f$ is a closed map. 
If $g  : M \to \mathbb  R$ is an exhaustion function, then $F : M \to \mathbb R^{k+1}, F(x) = (f(x),g(x))$, is an embedding. It suffices to show that $F$ is a closed map. So let $C \subset M$ be closed and let $(y,t)$ be contained in the closure of $F(C)$. Hence there exists a sequence $(x_n)$ in $M$ such that $F(x_n) \to (y,t)$, i.e. $f(x_n) \to y$ and $g(x_n) \to t$. W.l.o.g. we may assume that $g(x_n) < t + 1$ for all $n$. Hence $(x_n)$ is a sequence in $K = g^{-1}((-\infty, t+1])$ which is compact. Thus it has a convergent subsequence $(x_{n_k})$ with limit $x \in K$. Since $C$ is closed, we conclude $x \in C$. Thus $f(x_{n_k}) \to f(x)$ and therefore $f(x) = y$ by the uniqueness of limits. Hence $(y,t) \in f(C)$.
