Let's try to pin down the idea of the opposite category, which is a kind "mirror image" of a catgory, obtained by systematically reversing "left" and "right" in the construction of a category. Where do left and right appear?

Consider a morphism \$$f: A \rightarrow B\$$. We may view this as a relationship between \$$A\$$ and \$$B\$$, which object \$$A\$$ on the left and object \$$B\$$ on the right. In a mirror image category, we could have a mirror-twin morphism \$$f'\$$, with the labelling reversed, so that the left object of \$$f'\$$ is \$$B\$$ and the right object is \$$A\$$.

The standard names for 'left' and 'right' are 'domain' and 'codomain'.

The reversal is stated as follows:

\$dom(f') = cod(f)\$
\$cod(f') = dom(f)\$

The opposite \$$X'\$$ of a category \$$X\$$ has the same objects as \$$X\$$, and its system of morphisms consists of all the twins of the morphisms in \$$X\$$. (The standard nomenclature is \$$X^{op}\$$).

Now suppose that \$$f: A \rightarrow B\$$, \$$g: B \rightarrow C\$$ in \$$X\$$. This is a composable pair, and we may form the composition \$$f \triangleright g\$$.

To distinguish composition in the opposite category \$$X'\$$, let's use a different symbol for the composition operator.

For morphisms \$$u, v\$$ in \$$X'\$$, we'll write \$$u \triangleleft v\$$ for their composition in \$$X'\$$.

Having established this notation, now let's turn our attention back to the composable pair \$$f \triangleright g\$$ in \$$X\$$.

The question naturally arises: how can we form a composable pair from \$$f'\$$ and \$$g'\$$ in the opposite category \$$X'\$$?

First let's try \$$f' \triangleleft g'\$$. For that to work, as in any category, we would need that \$$cod(f') = dom(g')\$$.

But \$$cod(f') = dom(f)\$$, and that is not equal to \$$dom(g') = cod(f)\$$. Bzzt.

The other choice for the composable pair is \$$g' \triangleleft f'\$$, and this works well. Indeed, we do have that \$$cod(g') = dom(f')\$$, which follows from the premise that \$$cod(f) = dom(g)\$$.

In a word:

\$g' \triangleleft f' = (f \triangleright g)'\$

These three equations define the transformation of a category \$$X\$$ into its opposite category \$$X'\$$.