Show that if $M$ is a k-manifold near $x_0$, then its image $\varphi(M)$ is a k-manifold near $\varphi(x_0)$ 
Let $\varphi: R^n \rightarrow R^n$ be a diffeomorphism, and $M \subset R^n$.
If $M$ is a k-manifold near $x_0$, then its image $\varphi(M)$ is a k-manifold
near $\varphi(x0)$

I thought about using the following definition of a manifold:

There exists a permutation $(i_1,...,i_n)$ of $\{1,...,n\}$ and a mapping
$g:R^k \rightarrow R^{n-k}$, continuously differentiable near $({x_0}_{i_1},..., {x_0}_{i_k} )$, such that
$x \in M \Leftrightarrow g(x_{i_1},...,x_{i_k}) = (x_{i_{k+1}},...,x_{i_n})$ for all $x$ near $x_0$.

I want to show that $\varphi(x,g(x))=(\varphi(x), \varphi(g(x)))=(\varphi(x),g(\varphi(x)))$. ($x \in R^k$)
I am currently nor sure if I can do that, as in, I am not sure what conditions $\varphi$ and $g$ must meet to commute like that.
Thanks!
 A: You don't say "with boundary", so I assume you don't mean "$k$-manifold with boundary".
How I would do this:  A diffeomorphism (bidifferentiable bijection) is a homeomorphism (bicontinuous bijection), so it preserves dimension.  (Showing the dimensionality is preserved in detail uses the following facts:  A manifold is locally a copy of Euclidean $n$-space, $\Bbb{E}^n$.  Pick a point, $x$, and a neighborhood, $U$, which is homeomorphic to $\Bbb{E}^k$.  This neighborhood contains a $k-1$-sphere $S^{k-1}$ with $x$ in its interior.  Delete $x$ from the neighborhood.  (Note that the $S^{k-1}$ is no longer (relatively) contractible (in $U$) because we have deleted $x$.)  The reduced homology groups of a $k$-sphere are predictable as are the cohomology groups.  Under a homeomorphism, all of this is duplicated in the image (with $\phi(x)$ deleted), so you have an $S^{k-1}$ in the image.  Therefore, the image is (at least) $k$-dimensional.  It can't be more than $k$-dimensional by a rank-of-the-derivative argument, so it is $k$.)  Please note that many details and checks are glossed in the above.
How you are trying to do this:  You are trying to make something like the implicit function theorem work.  This can be done up until the local coordinates you are using are singular -- up until the tangent spaces reduce in dimensionality.  (Consider the implicit function for the upper half-sphere $z = \sqrt{1 - x^2 - y^2}$.  The tangent space is $2$-dimensional until $x^2 + y^2 = 1$, when it drops down to $1$-dimensional (around the equator at $z=0$).
You don't really want $\phi(g(x_\text{later})) = g(\phi(x_\text{later}))$.  You want a spanning set of $\langle x_\text{later}\rangle$ to remain a spanning set through $g\phi$ and through $\phi g$.  You check this by determining that the tangent space has full rank either way, i.e., by computing the Jacobian both ways and showing it has full rank.
