Q: Diffeomorphism onto a $k$-manifold in $\mathbb{R}^n$ If $A\subset\mathbb{R}^k$ and $B\subset\mathbb{R}^n$, with $k\leq n$, and $A$ is an open set, then for $f:A\longrightarrow B$ to be a diffeomorphism it must be bijective, continuously differentiable and its inverse must also be continuously differentiable in a sense of a function on an $k$-manifold in $\mathbb{R}^n$, i.e. composition of parameterization of parts of $f(A)$ with $f^{-1}$ must be continuously differentiable. I always see it carelessly stated as the inverse being differentiable without reference to manifolds, but if $k<n$, then$f(A)$ on which the inverse is defined is a set of Lebesgue measure zero in $\mathbb{R}^n$, so $f^{-1}$ cannot be differentiable in a usual sense. Is my definition of a diffeomorphism correct?
My second question is on the alternative definition of a diffeomorphism in this setting. If $f$ is continuously differentiable and its Jacobian matrix has full rank, then what other condition must $f$ meet in order for it to be a diffeomorphism?
Question 3: As per discussion in the comments another point of confusion appeared in my mind. Let $A$ and $B$ be open subsets of $\mathbb{R}^k$ and $f:A\longrightarrow B$ be both ordinarily differentiable and a diffeomorphsim. I'm wondering if such a situaton is possible that $f^{-1}$ is not ordinarily differentiable and status of $f$ as a diffeomorphism relies on a fact that every point of $f(A)$ has a naighborhood $N$ that can be parametrized by some $g:C\subset\mathbb{R}^n\longrightarrow N$ such that $f^{-1}\circ g$ is continuously differentiable.
EDIT2: I made an error while writing assumptions, $B$ is not supposed to be open when $k<n$. I also clarified my first question.
EDIT3: I rewritten my third question.

A: Perhaps an example will be illuminating:
Consider $k=1$, and $n=2$, let $A=\mathbb{R}$ and let $B=\{(x,x)\in\mathbb{R}^2:x\in\mathbb{R}\}$, that is, the points of the line $y=x$.
Consider $f:A\rightarrow B:x\mapsto (x,x)$.
$B$ is a submanifold of $\mathbb{R}^2$ of dimension $1$, and $f$ is a diffeomorphism between $A=\mathbb{R}$ and $B$.
