I’m answering myself because I think I learned the correct meaning of sections and retractions. I wasn’t understanding them properly. I will first define section and retraction and later I will challenge the exercises used in the original question.
Definitions:
For a morphism f from two undefined objects A and B: f: A → B
There's a section s: B → A iff f • s = 1B.
There's a retraction r: B → A iff r • f = 1A.
The Theorem of Uniqueness says:
If s is a section for f, and r is a retraction for f, them r = f.
In other words:
If f necessarily has a retraction r, the only possible section for f is r itself.
For two sets A and B where A ≥ B:
If A has all its elements mapped to B, so that f:A→B, and all elements of B are mapped to A, so that g:B→A, “g” is a section of “f” if (and only if) B elements remain intact (identity) after all the results of g:B→A are mapped back to B through f:A→B (thus f after g).
The retraction of “f“ would exist if “g“ (or any other morphism B→A) would satisfy the rule: “g“ after “f“ is the identity of A.
The morphism “f“ could be a retraction if “f“ after any morphism ends up being 1B. In fact, as “f“ after “g“ is the identity of B, we can also say that “f“ is a retraction of “g“.
More resources:
As described by Wikipedia (on sections):
A section is a right inverse of some morphism. Dually, a retraction is a left inverse of some morphism. In other words, if f : X → Y and g : Y → X are morphisms whose composition f o g : Y → Y is the identity morphism on Y, then g is a section of f, and f is a retraction of g.
Every section is a monomorphism, and every retraction is an epimorphism.
Wikipedia also states that “a monomorphism is an injective homomorphism” and that “a homomorphism is a structure-preserving map between two algebraic structures of the same type”. Also that “Epimorphisms are categorical analogues of surjective functions”. Therefore, sections are injective functions and so they require a left inverse, and retractions are surjective functions and so they require a right inverse.
Now, specifically on retractions, Wikipedia says that: "In topology, a branch of mathematics, a retraction is a continuous mapping from a topological space into a subspace which preserves the position of all points in that subspace. A deformation retraction is a mapping which captures the idea of continuously shrinking a space into a subspace.".
As a side note, the book of Conceptual Mathematics says that retractions are easy to find once an idempotent map "e" is found to be mapping all of the elements of a larger object into itself, effectively "sorting" it and thus maintaining the order.
On the examples I provided in the original question:
Having sorted out the definitions, it’s clear that the examples in the original question are incomplete, and it’s the result of some confusion.
In the first example,
- All people in A live in the same country B (the codomain B has one element). The verb “live” stands for: f:A→B
- Therefore, A > B.
- The country B has a representative in A, thus: g:B→A
- This one representative makes viable a section from B to A on g, because f:A→B after g:B→A is 1B, the identity on B.
- There is no retraction of “f” because there’s no way to recover the identity of A after we’ve mapped it into B.
- However, there's a retraction between the maps A and B, since every person is related to their country representative by an idempotent map, so the representatives effectively sort the whole population into the same groups of people related to each country.
- This retraction is necessarily f, and it is going to be a retraction of the section g, with a resulting identity on B.
- Given any group of criteria in an object T defining the population A, two relationships of T with A called x1 and x2 don’t need to be the same if we only know that the result of f(x1) = f(x2), because many people from A living in a same country B can be associated with many traits from T.
On the second example:
- A is an object composed of some countries. B is the set of all people, so A ≤ B.
- All people live in countries, so g:B→A.
- There’s a representative per country, so f:A→B.
- The morphism g is a retraction of f as long as g after f is the identity on A, which is true since all people is related to their representatives by country, thus there's an idempotent map in B.
- There is going to be a section of f as long as the amount of people in B has the same size of A (which is valid under A ≤ B), so that f after g is the identity on B. In this case, A and B would be isomorphic.
- The is also a section f of g, because g after f is 1A. The representative lives in the country it represents. Thus f is a section of g as much as g is a retraction of f.
- If there’s a criteria defining A, called T, of which any two maps x1 and x2 are equal after f, so that f(x1) = f(x2), then x1 = x2. Imagine a set of criteria A that define the representatives of every country, criteria mapped to an unknown representative of a known country immediately reveal the representative, for the definition of the section, not because of the criteria themselves.
An example of a similar category of objects without retraction would be one without an idempotent map. For example: if we would compare representatives of a specific political party by state, then even though each representative is related to a state, and every person is related to a state, not every person would be related to the representative of the political party of that state, since not every person necessarily belongs to that political party.