smooth embedding between manifolds I'm sightly confused about the definition of an embedding between manifolds. (There seems to be several formulations and apparently they are meant to be equivalent.) From what I gather a smooth map $f: M \to N$ between manifolds is an embedding if it is (1) an immersion (smooth and derivative is injective), and (2) it is a topological embedding (homeomorphism onto image)
With this definition, the image of an embedding is a manifold (a submanifold of $N$) and $f$ is a diffeomorphism onto its image. 
To fully understand this definition, can someone give me an example of (a) an injective immersion that is not an embedding (for example if the image is not a manifold), and (b) the necessity of the requirement of it being an immersion (for example a smooth injection whose image is not a manifold).
PS. I have seen an example of (a) that is the injective immersion from $\mathbb{R}$ to the figure 8 in $\mathbb{R}^2$ by taking $\pm \infty$ to the intersection of the figure 8 from top right/ bottom left. But I'm having trouble confirming why it's not a homeo onto image (it's clearly bijective but why is it not continuous wrt to the subspace topology of the figure 8 in $\mathbb{R}^2$?)   
 A: Let's call $\phi$ the parametrization of the 2-torus in $\mathbb{R}^4$,  such that: $\phi: \mathbb{R}^2 \to T^2 =(\sin(x),\cos(x),\sin(y),\cos(y))$. Now, let $\pi$ be a line in $\mathbb{R}^2$ with irrational angolar coefficient, let's set it at $\sqrt{2}$. Let $\varphi:=\phi_{\vert \pi}$. Thus, the mapping is differentiable and it is, in fact an immersion, but is not  an embedding, since the image is one-dimensional (yet, these sub-manifold is dense in the torus). Actually, in both these example and in yours, the patological behaviour is in some dense caused by the fact that those mappings are not "proper", they map too many points near infinity near to others. Formalizing this definition, we get the embedding' definition.
It is necessary for it to be an immersion since, if it is not, thus the jacobian matrix won't have maximum rank somewhere, and thus the transformation won't be invertible
A: Here's an example of the second thing you ask for: a smooth injection whose image is not a submanifold.  It's a bit different from the $\mathbb{R}$-to-figure-$8$ example, because it will be a topological embedding, but not a smooth embedding.  In other words, it's a smooth map satisfying $(2)$, but not $(1)$.  In fact, it will be an immersion except at one point.
Let's construct the example.  First, let $\phi(x) = \begin{cases} e^{-1/x^2} & x > 0\\ 0 & x\leq 0\end{cases}$.  This is the standard example of a function which is is smooth at $x=0$, but not analytic there.  The point is that all derivatives of $\phi$ vanish at $x=0$.  Note also that $\phi(1) = e^{-1}$, so $e\phi(x)$ has the property that it maps $[0,1]$ monotonically onto $[0,1]$.
Now, define $f:(0,2)\rightarrow \mathbb{R^2}$ via $$f(t) = \begin{cases} (1-e\phi(1-t),0) & t\in (0,1]\\ (1, e\phi(t-1)) & t\in [1,2)\end{cases}.$$
Viewing $f$ as describing the path of a particle, the partical is essentially starting at $(0,0)$ (except that $t=0$ is not in the domain), and moving to the right.  As it gets closer and closer to $(1,0)$, it slows down in such a way the derivatives of all orders at $t=1$ are $\langle 0,0\rangle$.  After instantaneously pausing at the point $(1,0)$, it begins to move up, finishing its journey at the point $(0,1)$ (or rather, it never quite gets to $(0,1)$.
So, the image is the bottom and right side of the standard unit square.  It maintains smoothness at the corner by giving up on being an immersion there.
