Let $A$ and $B$ denote sets.
Definition. Given a partial map $f : A \rightarrow B$, let us define that a partial inverse of $f$ is any partial map $g : B \rightarrow A$ satisfying $$fg \leq \mathrm{id}_A, \qquad gf \leq \mathrm{id}_B,$$
Notation. Expressions of the form $p \leq q$ mean that for all $a \in A$, if $p(a)$ is denoting, then so too is $q(a)$, and $p(a) = q(a)$.
I have a sneaking suspicion that the following are equivalent:
$f$ is injective
$f$ has a maximal partial inverse
$f$ has a partial inverse $g$ satisfying $fgf = f$ and $gfg = g.$
I'm pretty confident about the equivalence between $1$ and $2$. Let's collectively call these two condition $(*)$ since they're equivalent.
Also I can prove that $(*)$ implies $3$, but the converse is non-obvious (to me, at least).
Question. Does 3 implies $(*)$?
If so, I request a proof.