The notion of semicategory or non-unital category is like that of category but omitting the requirement of identity?-morphisms.
This generalizes the notions of semigroup, semiring, etc:
a semigroup is (the hom-set of) a semicategory with a single object;
a semiring is (the hom-set of) a semicategory enriched in Ab with a single object.
Semicategories, like categories, appear as semipresheaves on the category with two objects and two morphisms.
A (small) semicategory or non-unital category $\mathcal{C}$ consists of
a set $\mathcal{C}_1$ of morphisms (or arrows);
two functions $s, t : \mathcal{C}_1 \to \mathcal{C}_0$ called source (or domain) and target (or codomain);
a function $\circ \colon \mathcal{C}_1 \times_{t,s} \mathcal{C}_1 \to \mathcal{C}_1$ (composition) from the set of pairs of morphisms such that the target of the first is the source of the second;
such that the following properties are satisfied:
source and target are respected by composition: $s(g \circ f) = s(f)$ and $t(g\circ f) = t(g)$;
composition is associative: $(h \circ g)\circ f = h\circ (g \circ f)$ whenever $t(f) = s(g)$ and $t(g) = s(h)$.
If one added to this definition the existence of a function $i \colon C_0 \to C_1$ such that for all $c \in C_0$ the morphism $i(c)$ is an identity? on $c$ under the given composition, then one has the defintion of a category.
However, having identities is just an extra property on a semi-category, not extra structure. For more on this see below at Relation to categories.
One often writes $hom(x,y)$, $hom_C(x,y)$, or $C(x,y)$ for the collection of morphisms $f : x \to y$; the latter two have the advantage of making clear which category is being discussed. People also often write $x \in C$ instead of $x \in C_0$ as a short way to indicate that $x$ is an object of $C$. Also, some people write $Ob(C)$ and $Mor(C)$ instead of $C_0$ and $C_1$.
For $\mathcal{C}, \mathcal{D}$ two semicategories, a semi-functor $F \colon \mathcal{C} \to \mathcal{D}$ is a pair of functions $F_0 \colon \mathcal{C}_0 \to \mathcal{D}_0$, $F_1 \colon \mathcal{C}_1 \to \mathcal{D}_1$ that respects all the given structure in the obvious way.
Write $SemiCat$ for the (large) category whose objects are semicategories, and whose morphisms are semifunctors.
We discuss the relation of semicategories to categories. (See for instance the beginning of (Harpaz) for a quick review of basics, with an eye towards their generalization to the relation between complete Segal spaces and complete semi-Segal spaces.)
There is an evident forgetful functor
from the category Cat of categories to that of semicategories, def. 2, given simply by forgetting the identity-assigning map $i \colon \mathcal{C}_0 \to \mathcal{C}_1$ in a category.
For $\mathcal{C}$ a semi-category, def. 1, write
for the subset on those morphisms which are endomorphisms on some object $x \in \mathcal{C}_0$ and such that they are neutral elements in their endomorphisms semimonoids $End_{\mathcal{C}}(x)$.
A semicategory is the semicategory underlying a category, hence is in the image of the functor $U$ of def. 3, precisely if every object has a neutral endomorphism, hence precisely if the composite diagonal function in
is an isomorphism, where the horizontal function is that of def. 4.
Moreover, if a semicategory lifts to a category, it does so in a unique way: the functor $U \colon Cat \to SemiCat$ is an injection on isomorphism classes.
Equivalently one could use the target map instead of the source map in the formulation of prop. 1.
The diagram appearing in prop. 1 is a simple version of the univalence condition appearing in definition of a complete semi-Segal space, a semi-category object in an (infinity,1)-category. See there for more on this.
The functor $U$ of def. 3 has a left adjoint, which freely adjoins identity morphisms to a semicategory in the obvious way. It also has a right adjoint, which sends a semicategory $S$ to the category whose objects are the idempotents of $S$ and whose morphisms are the morphisms of $S$ that commute suitably with them, as described at Karoubi envelope. Indeed, the monad on Cat generated by this latter adjunction is exactly the monad for idempotent completion, also called Cauchy completion. (Note, however, that this is not a 2-monad, because the right adjoint of $U$ is not a 2-functor.)
The nerve of a semicategory is a semi-simplicial set which satisfies the Segal conditions.
Start with the category of metric spaces and short maps. An occasionally useful semicategory can be formed from it by considering the nonempty spaces and strictly contractive functions.
This is a semicategory, since:
The interest in this semicategory arises from the fact that all morphisms $f : A \to A$ have unique fixed points, by Banach’s fixed point theorem.
The concept of semicategory has more or less evident analogs and generalizations in higher category theory.
For models of higher categories by simplicial sets, i.e. presehaves on the simplex category (such as Kan complexes, quasi-categories, weak complicial sets) the corresponding semi-category notion is obtained by discarding the degeneracy maps (which are the identity-assigning maps in the simplicial framework), i.e. by considering just presheaves on the subcategory $\Delta_+ \subset \Delta$ on injective morphisms (see the discuss of $\Delta_+$ at Reedy model structure for more details).
Accordingly, there is the semi-category analog of a Segal space, called a semi-Segal space.
Simpson's conjecture says that every $\infty$-category has a model where all composition operations are strict and only the unit laws hold up to coherent homotopies. This would mean that the $\infty$-semicategory underlying any $\infty$-category can always be chosen to be strict.
Semicategories and semigroups are mentioned for instance in section 2 in
Semicategories with an eye towards their generalization to semi-Segal spaces are briefly discussed at the beginning of
Structures obtained by further relaxing also the associativity law are discussed in