Exercise 1.15.2 of Burns and Gidea's differential geometry/topology states that:
Exercise 1.15.2: Consider a bijection between the real line $\Bbb R$ and the sphere $\Bbb S^2$ (such a bijection exists since these are sets with same cardinality). Show that the composition of the local parametrizations of $\Bbb S^2$ from above with this bijection defines a smooth structure on $\Bbb R$. Show that $\Bbb R$ endowed with this smooth structure is diffeomorphic to the sphere $\Bbb S^2$. With this smooth structure, the real line is a sphere! The point of this exercise is to stress that a manifold is not just a set that can be endowed with some structure, but the set together with that structure.
If so what is the role of invariance of dimensions? It seems that this exercise is a serious mistake by authors!!
In the page 67, exercise 1.15.5 claims that
Exercise 1.15.5: Provide the unit cube $Q\subset \Bbb R^{n+1}$ with a smooth structure. The point of this exercise it to illustrate that a smooth manifold may not look smooth! Of course this smooth structure is not compatible with the smooth structure of $\Bbb R^{n+1}$.
Is the claimed statement correct? I have no idea about $n>2$ but in $n=1,2$ I think it is wrong by unique differential structure in dim$<4$!
The point is that you endow the set $\mathbb R$ with a topology (and a smooth structure) which has nothing to do with its usual topology (and smooth structure).
In fact, the general construction is this:
Let $M$ be a smooth manifold, $X$ be set and $h : X \to M$ be a bijection. Then there exists a unique topology $\tau$ on $X$ such that $h$ becomes a homeomorphism. Moreover, there exists a unique smooth structure on $(X,\tau)$ such that $h$ becomes a diffeomorphism.
If you reflect upon this, there is no surprise in it. What is confusing you is this: We start with a smooth manifold $N$ and take a bijection $h : N \to M$. This map is not subject to any restrictions, it may not even be continuous. But it induces a smooth structure on the set $N$ such that $h$ becomes a diffeomorphism. But, as we have seen above, this smooth structure is not related to the original smooth structure of $N$.