Consider the following definition, where immersions are defined:
Later the author states:
The problem: In the definition, a regular function is defined to have constant rank in particular. But later it is stated, as if it were something that would need a proof, that the rank of an immersion (which in particular is a regular function), is constant in a neighborhood. This doesn't make sense.
What am I missing here? Maybe the author messed up the definition of "regular function" and assumed too much?
Later the author states "Let $\varphi$ be regular at $0$, i.e. $D\varphi (0)$ is injective. How can I make sense of this, if regularity was defined as a property holding for the whole domain, not just a single point? (Also, $D\varphi (0)$ being injective is something that pertains to an immersion, not a regular function, according to the definitions above.)


The underlined part in second picture actually has nothing to do with the first picture. That is simply an application of the property of continuous functions.
Update
If not defined, then you may understand the regularity as
When the author says
there should be some statements before about the dimensions of domain and codomain, otherwise this is not fully supported.