Two proof of Petersen's 'Manifold' Picture below is from the 5 page of Petersen's Manifold.
First, why diffeomorphism is forced to be a lieanr  isomorphism? The define of diffeomorphism accords to Wiki.
Second , what space the point $p$ is in ?And $A^n$ is a set or coordinate map ?



 A: If $f: \Bbb R^n \to \Bbb R^m$ is a diffeomorphism, then $f^{-1}:\Bbb R^m \to \Bbb R^n$ exists, and the equation $f^{-1}\circ f = {\rm id}$ gives $Df^{-1}(f(p))\circ Df(p) = {\rm id}$, whence $Df(p)$ has a left-inverse. Differentiating $f\circ f^{-1}={\rm id}$  at the point $f(p)$ gives that $Df^{-1}(f(p))$ is also a right-inverse for $Df(p)$, so $Df(p)$ is a linear isomorphism. This in particular forces $n=m$.
For the second part, the idea is to consider the set of points in $M$ that have coordinates using $n$ functions, that is $A^n$, and then check that $A^n$ is both open and closed in $M$. In details: $$A^n = \{ p \in M \mid \text{exists }U \subseteq \Bbb R^n \text{ open and a parameterization }\varphi\colon U \to M \text{ around }p\}.$$By connectedness of $M$, we'll have that $A^n = M$ for the $n$ satisfying $A^n \neq \varnothing$ (meaning that the dimension will be decided by one point). It really is clear that $A^n$ is open, so to see closedness, we take a convergent sequence in $A^n$ and see that the limit is in $A^n$ too. Suppose that $p_i \to p$. Since $p \in M$, there is a coordinate system around $p$ using $m$ functions, but $p_i \to p$, so that coordinate system works for $p_i$ too, for large enough $i$. But $p_i \in A^n$, so that coordinate system must actually use $m=n$ functions.

A linear isomorphism is a bijective linear transformation. Being bijective is equivalent to having both sided inverses. This is just linear algebra.
I'll elaborate more on your second question: since $p\in M$, there is an open set $p \in V \subseteq M$ and $U\subseteq R^m$ open such that we have a coordinate system $\varphi: U \to V$ around $p$. By definition of convergence, there is $i_0$ such that $p_i \in V$ for all $i \geq i_0$. Then $\varphi: U \to V$ is a coordinate system around $p_{i_0}$, for example, and now $p_{i_0} \in A^n$ implies $m=n$.
