# The boundary orientation coincides with the preimage orientation

Prove that the boundary orientation of $S^k=\partial B^{k+1}$ is the same as its preimage orientation under the map $g: \mathbb R^{k+1}\to \mathbb R$, $g(x)=|x|^2$.

The boundary orientation is given by orienting each tangent space $T_x(S^k)$. Each of those is oriented by declaring the sign of a basis $(v_1,\dots,v_k)$ of $T_x(S^k)$ to be the sign of the basis $(n_x, v_1,\dots,v_k)$ of $T_x(B^{k+1})$. (Here $n_x$ is the outward normal to $S^k$ at $x$.)

As I pointed out here, I don't really understand the concept of the preimage orientation, so I was hoping someone would be able to illustrate it by this example (which seems to be a basic one).

(To begin with, I don't even understand what is the $Z$ from the definition in the question cited above.)

Since the sphere is connected, it suffices to check that the orientations agree at a point. If $e_1,\dots e_{k+1}$ is a positively oriented orthonormal basis of $\mathbb{R}^{k+1}$, then at the point $e_1 \in S_k$, the basis $e_2, \dots e_{k+1}$ for $T_{e_1}S^k$ is positively oriented according to the boundary orientation.
We can think of the unit sphere as the preimage of $1$ under $g$, that is, $S^k=g^{-1}(1)$. So we set $Z$ to be the singleton $\{1\}\subset \mathbb{R}$ with its tangent space the positively oriented zero vector space (usually when a point is not given an explicit orientation, you can just take it to be positively oriented).
Now the tangent vectors pointing out from the sphere are mapped by $dg$ to positive real numbers and the vectors pointing into the sphere are mapped by $dg$ to negative real numbers. Any positive real number is a positively oriented basis for $\mathbb{R}=T_1\mathbb{R}$, so using the formulas in the linked post, you can see that indeed the preimage orientation is the same as the boundary orientation: if the outward normal followed by a basis for $T_xS^k$ is positively oriented for the whole ball, that basis is oriented for the sphere.