Isomorphisms in terms of pullbacks Given functions $f : X \rightarrow Y$ and $g : Y \rightarrow X,$ we say that $f$ and $g$ are inverses iff the following holds.
$$fx = y \Leftrightarrow x=gy$$
We can rehash this condition in terms of pullbacks. Given functions $p,q: A,B \rightarrow C,$ define that their pullback is $$p \times_C q = \{(a,b) \in A \times B \mid pa = qb\},$$
in which case it follows that any two functions $f : X \rightarrow Y$ and $g : Y \rightarrow X$ are inverses iff $$(*)\quad f \times_Y \mathrm{id}_Y = \mathrm{id}_X \times_X g.$$
Now as Berci points out, the above pullbacks exist in any category.
Question: Is there a way to phrase $(*)$ so that it makes sense in arbitrary categories?
 A: Well, the mentioned pullbacks do exist in any category, and they are isomorphic to $X$ and $Y$, respectively:

$f\times_Y 1_Y\,\cong X\ \ $ and $\ \ 1_X\times_X g\,\cong Y$,

so, we indeed have a statement in general: $f\times_Y1_Y\cong 1_X\times_Xg\ \iff\ X\cong Y$, though it sounds somewhat trivial.
(In full generality I'm afraid we cannot expect more, as pullbacks are unique only up to isomorphism, so we can hardly interpret strict equations.)
A: We can reformulate your pullback a little: $f:X\to Y,g:Y\to X$ are mutual inverses just if $Y$ is a pullback $f\times 1_Y$ with upper legs of the pullback square $g$ and $1_Y$ or, equivalently, if $X$ is a pullback $g\times 1_X$ with upper legs $f$ and $1_X$. This is still pretty vacuous, but at least all the maps in the diagram are determined.
Here's a somewhat analogous situation in which there's a less empty result: a map $f:X\to Y$ is a monomorphism if and only if $X$ is a pullback $f\times_Y f$ with the upper legs of the pullback square both $1_X$. In the same way $f$ is an epimorphism if and only if the dual square is a pushout. So you can get that $f$ is mono and epi by examining two squares, though they're not both pullbacks. In many (but not all!) categories, for instance abelian categories and toposes, that's enough to show $f$ is an isomorphism.
