It is well-known that the category of topological pairs is of great use in algebraic topology. Its construction is standard.
Similarly, I just read in Jacobs' "Categorical Logic and Type Theory" about the category of predicates, which is the category of pairs of sets $(X,A)$ where $A \subseteq X$, with morphisms $u: (X,A) \to (Y,B)$ being commutative squares $$ \begin{array}{ccc} X &\to &Y \\ \uparrow & & \uparrow \\ A &\to &B. \end{array} $$
Now clearly these two constructions are almost the same, probably the cases $\mathcal{C} = \mathrm{Top}, \mathrm{Set}$ of a general procedure. It is not something so simple as the arrow category $\mathcal{C}^2$ because of the subobject condition, but it shouldn't be very far. My questions are:
- In what level of generality can we apply this construction?
- What is the procedure in general? (Does it even have a name?)
- Are there other examples that are used in nature?
The level of generality depends on what properties you want to keep, but the "closest" is arguably the notion of a subobject fibration which only requires $\mathcal{C}$ to have pullbacks (or even just pullbacks along monomorphisms). It is closely related to the codomain fibration (basically it's a codomain fibration restricted to subobjects). You can then, of course, look at fibrations (fibered categories) generally. This and similar constructions are the basis for the notion of internal logic of a category. The Ingo Blechschmidt talk referenced at the bottom of the last page is a nice exposition of taking an internal logic point of view via Kripke-Joyal semantics to algebraic geometry. Olivia Caramello's chapters on topos theory give technical background and examples of this approach. I assume Bart Jacobs will provide plenty of details and examples as well. In some sense, these ideas are omni-present; it's just a matter of whether you want to look at things this way.