The concept of orientation looks so magical if we think of various formulations all describe exactly the same mathematical phenomenon, while they are all rooted on the classic idea of choice of direction, right or left, plus or minus, or man or woman.

To put out the algebraic view of orientation, consider finite discrete set X=\{x_0,x_1,\ldots,x_n\} (can be seen as a set of points in general position in n dimensional affine space) and its permutation group S(X). The kernel of \bf{sgn}: S(X)\to \mathbb{Z}_2 induces the unique choice of direction for each permutation. In case of n=2, it coincides with the common sense of orientability: [a_0 a_1] corresponds to the right and [a_1 a_0] corresponds to the left.

For its connection with topology, we think it is important to describe the case when a space is manifold so one can study further variants (e.g. pseudo-manifold, vector bundle, etc.) derived from the case of manifold. It is notable that the orientability is preserved by homeomorphism but not a homotropy invariant (compare mobius band and a circle for example).

Thanks to its locally Euclidian property (and its consistent dimension), the orientation can always be defined locally on topological manifold M; but not for globally over M.

Let R be a commutative ring with unit. For a topological n-manifold M, define a covering space p:M_R\to M as

    \[M_R=\{\mu_x\otimes r : \mu_x\in H_n(M,M-x), r\in R\}.\]

Here we restrict \mu_x to a generator of H_n(M,M-x) to see an element of H_n(M,M-x;R) via canonical isomorphism H_n(M,M-x;R) \cong H_n(M,M-x)\otimes R. Then we have a fiber p^{-1}(x)=\mu_x\otimes R\cong R. Topologizing M_R with an open basis

    \[\{U(\mu_B)\subset M_R: B\subset M\text{ is open ball with finite radius}\},\]

where U(\mu_B) is a collection of an element \mu_x\otimes r such that x\in B and \mu_x is the image of \mu_B\in H_n(M,M-B;R) by the canonical map H_n(M,M-B;R)\to H_n(M,M-x;R). Then M_R is a covering space with local triviality condition p^{-1}(B)=U(\mu_B)\cong B\times R. We always have two sheeted orientable sub-covering space M_{1_R} where 1_R denotes a generator of R (the fiber over x is \{\pm \mu_x\otimes 1_R\}).

A section of a covering space is a continuous right inverse of covering projection. The orientation is the section s:M\to M_R with \mu_x a generator of H_n(M,M-x) for each x\in M. Note that by construction of the covering space, a section encodes local consistency (of a local orientation) if and only if the section represents the orientation:

A function s:M\to M_R has local consistency if for each x\in M, there exists an open neighborhood B\subset M of x such that for each y\in B, s(y) is the image of \mu_B by the map H_n(M,M-B)\to H_n(M,M-x).

Lemma 3.27. Let M be a manifold of dimension n and let A\subset M be a compact subset. Then:

(a) If x\to \alpha_x is a section of the covering space M_R\to M, then there is a unique class \alpha_A\in H_n(M,M-A;R) whose image in H_n(M,M-x;R) is \alpha_x for all x\in A.

(b) H_i(M,M-A;R) = 0 for i>n.

A. Hatcher, Algebraic topology, Cambridge Univ. Press, 2000

Let \Gamma_R(M) be the set of sections of M\to M_R. Sum and scalar multiplication of sections are again sections, so \Gamma_R(M) is a R-module.
The lemma indicates that the homomorphism \phi:H_n(M,M-A;R)\to \Gamma_R(A) defined by \phi(\alpha)=(x\to \alpha_x) is an isomorphism.

Suppose A is connected, then the evaluation map \Gamma_R(A)\to H_n(M,M-x;R) is injective, since the value of a single point determines the given section uniquely.
For it to be surjective, consider the case when A=M, which is to say when M is a closed manifold. The composition

    \[H_n(M;R)\xrightarrow[\phi]{\cong} \Gamma_R(M)\xrightarrow[e]{} H_n(M,M-x;R)\]

is surjective if a section exists such that each point x\in M is sent to a generator \mu_x\otimes u where u is an unit of R (Note that a section s:M\to M_R always exists for each [\alpha]\in H_n(M;R) by setting s(x)=\phi_x([\alpha]) where \phi_x:H_n(M;R)\to H_n(M,M-x:R) is the canonical map).

To reduce the orientability to the number of components in the orientable covering space (deduced from a connected manifold), we think of a lemma regarding the n-folded covering space over a connected manifold:

Lemma. Let M be a connected manifold. For n-sheeted covering projection p:\tilde{M}\to M, \tilde{M} has n components iff p|_{\tilde{C}}:\tilde{C}\to M is homeomorphism for any component \tilde{C}\subset \tilde{M}.

The proof is straightforward.
If p|_{\tilde{C}} is homeomorphism, then for any component \tilde{C}\subset \tilde{M}, there are no distinct two points \tilde{x_1},\tilde{x_2}\in \tilde{C} such that p(\tilde{x_1})=p(\tilde{x_2}) so each fiber can intersect only once with each component. This shows that the number of components of \tilde{M} is n or greater than n. If it is greater than n, there is a component \tilde{C}\subset \tilde{M} and a point x\in M such that p^{-1}(x)\cap \tilde{C}=\emptyset. Because M is connected, a choice of point in fiber determines the component uniquely (owing to path lifting property), we conclude that p^{-1}(M)\cap \tilde{C}=\emptyset, contradiction.
For the reverse direction, if \tilde{M} has n components, each point in fiber distributes evenly to each component, implying that p|_{\tilde{C}} is injection (as in previous discussion). Because the fiber cannot be empty, p|_{\tilde{C}} must be surjection onto M.

Now that we introduce a remarkable result for a case of closed manifold:

Theorem 3.26. Let M be a closed connected n manifold. Then:
(a) If M is R-orientable, the map H_n(M;R)\to H_n(M,M-x;R)\cong R is an isomorphism for all x\in M.
(b) If M is not R-orientable, the map H_n(M;R)\to H_n(M,M-x;R) \cong R is injective with image \{r\in R | 2r = 0 \} for all x \in M.
(c) H_i(M;R) = 0 for i > n.

A. Hatcher, Algebraic topology, Cambridge Univ. Press, 2000

For the last part of (b), identify H_n(M;R) with \Gamma_R(M). Since the section s:M\to M_1 of two sheeted covering with coefficient R gives homeomorphism, we have s(x)=-s(x) for all x\in M. Because the image of the map H_n(M;R)\to H_n(M,M-x;R) is exactly the sum of such s(x), namely \big\{\sum_{s\in \Gamma_R(M)} s(x)\big\}, it follows the result.

It is remarkable that every manifold M is \mathbb{Z}_2-orientable, without assuming that M is compact or connected (to remove the without boundary condition, we need to treat collar neighborhood properly, which we would not do in this article). This is because the homeomorphic covering projection p:M_1\to M can be defined, or the section s:M\to M_1 suffices local consistency since the isomorphism \mathbb{Z}_2\cong H_n(M,M-B;\mathbb{Z}_2)\to H_n(M,M-x;\mathbb{Z}_2)\cong \mathbb{Z}_2 is unique).