A doubt about the construction of a linear map $T$ such that $T:\mathbb R^N \to \mathbb R^p$ such that $K \cap \operatorname{ker} T = \{0\}$
I agree with Kavi in comments, but I think I understand your confusion. What is happening is that since $K := \operatorname{ker}(d f_x)$ is a linear subspace of $\mathbb{R}^N$, there exists a direct sum decomposition $\mathbb{R}^N \cong K \oplus (\mathbb{R}^N / K)$. However, this decomposition is noncannonical, which means that it involves an arbitrary choice. If you like, here the arbitrary choice is how to extend a basis for $K$ to a basis of all of $\mathbb{R}^n$. Nonetheless, we are allowed to just pick one such decomposition. Then we can define a linear map $T$ from $\mathbb{R}^N$ to $\mathbb{R}^p$ by defining it on each factor $K$ and $\mathbb{R}^N / K$ of the direct sum (however once again, the resulting linear map $T$ will depend on the arbitrary direct sum decomposition we picked, hence the book says "any linear map"). Then we choose to define $T$ on $\mathbb{R}^n / K$ as zero, and something interesting on $K$.
Your comments imply that you are not so familiar with the notion of direct sums of vector spaces, so let me give two perspectives on the same construction: one which we build with our "bare hands", and then formulated again using the notion of direct sum to clarify what we are doing.
First, with our bare hands: a linear map $T : \mathbb{R}^N \to \mathbb{R}^p$ is determines and is completely determined by where it sends a basis of $\mathbb{R}^N$. So, if we want to construct such a linear map $T$, we can start by choosing a basis $\{ v_1, \ldots, v_p \}$ of $K = \ker d f_x$. This is a linearly independent subset of $\mathbb{R}^N$, so by adding $N - p$ additional vectors we can extend this to a basis $\{v_1, \ldots, v_p, u_1, \ldots, u_{N - p}\}$ of $\mathbb{R}^N$. Now define $T : \mathbb{R}^N \to \mathbb{R}^p$ by mapping each $v_i$ to the element $e_i$ of the standard basis of $\mathbb{R}^p$, and also mapping each $u_j$ to zero. Then we have constructed a map $T$ of the desired form (though note that we have made a lot of choices when we picked all of these basis elements, so again the map $T$ is of course not unique and depends on these choices).
But second, what we are really doing here is the following thing: we have picked an isomorphism $A : K \to \mathbb{R}^p$ and an isomorphism $B : \mathbb{R}^N \to K \oplus (\mathbb{R}^N / K)$, note that both choices are nonunique[1], and then we have just defined $T$ to be the composite $$ T : \mathbb{R}^N \xrightarrow{B} K \oplus (\mathbb{R}^N / K) \to K \xrightarrow{A} \mathbb{R}^p, $$ where $K \oplus (\mathbb{R}^N / K) \to K$ is just the projection onto the subspace $K$. This is what our choices of basis vectors above got us: the basis $\{v_i\}$ determines the isomorphism $A$, and the extension to a basis of all of $\mathbb{R}^N$ by the addition of the vectors $\{u_j\}$ determines the isomorphism $B$.
[1]: Note that technically we need $B$ to respect the inclusion $K \hookrightarrow \mathbb{R}^N$, but...
Final remark: note that while your "dimension based" reasoning about the direct sum in comments isn't wrong, it's a bit complex and doesn't at the outset respect the inclusion $K \hookrightarrow \mathbb{R}^N$. Instead note that what you have written down is the so-called external direct sum (which is fine and is the normal one), but in this situation probably the notion of internal direct sum is helpful. You can look this up, but it turns out (and is a good exercise) that if $V_1, V_2 \subseteq V$ are vector subspaces with $V_1 \cap V_2 = \{0\}$ and $\operatorname{span}(V_1 \cup V_2) = V$ then $V$ is isomorphic to the (external) direct sum $V_1 \oplus V_2$. In other words, each element of $V$ is uniquely a sum of an element of $V_1$ and an element of $V_2$ (hence the name "internal"). A consequence of this for example is that a linear map $T : V \to W$ then completely determines and is determined by its restrictions $T \rvert_{V_1} : V_1 \to W$ and $T \rvert_{V_2} : V_2 \to W$ to $V_1$ and $V_2$.