How to understand cocategories $\newcommand\CC{\mathsf{C}}$The notion of a category is well-known. There are multiple equivalent definitions; small categories can be seen as an internal category in $\mathsf{Set}$, that is


*

*a couple $(\CC_0, \CC_1)$ of sets (respectively, objects and morphisms);

*maps "target" and "source" $d_0, d_1 : \CC_1 \to \CC_0$;

*a map "identity" $s_0 : \CC_0 \to \CC_1$;

*a composition map $\gamma : \CC_1 \times_{\CC_0} \CC_1 \to \CC_1$;


satisfying some axioms (cf. the $n$Lab page for details, basically the axioms of a truncated simplicial set, associativity and unitality for composition).
This notion readily dualizes and one can define a small cocategory to be a category internal in $\mathsf{Set}^\mathrm{op}$.

How to understand this notion of cocategory?

From the definition, a cocategory is a pair of sets $(\CC^0, \CC^1)$ with "cotarget" and "cosource" maps $d^0, d^1 : \CC^0 \to \CC^1$, a "coidentity" $s^0 : \CC^1 \to \CC^0$, and a cocomposition map $\gamma^c : \CC^1 \to \CC^1 *_{\CC^0} \CC^1$, satisfying some axioms. I have tried playing with the axioms, but I don't really have an intuition for what's going on. I think first I should try to understand what a cograph is (everything but the $\gamma^c$), and then add the $\gamma^c$, but even then it seems hard to even put names on things (cosource? cotarget?...). And the pushout in the definition of $\gamma^c$ throws me off, why should an object go in one factor or the other...?

Another definition of (dg-)categories with a given set of objects $X$ is the following: consider the ring
$$k\{X\} = \Bbbk[1_x]_{x \in X} / (1_x 1_y - \delta_{x,y} 1_x).$$
(In other words it's a $k$-algebra generated by orthogonal idempotents $1_x$.) Then a dg-category over $\Bbbk$ with set of objects $X$ is an associative, unital dg-algebra $A$ over $\Bbbk\{X\}$ (the morphisms $x \to y$ are the elements of $1_x \cdot A \cdot 1_y$). Similarly, one can define a dg-cocategory over $\Bbbk$ with set of objects $X$ as a dg-coalgebra (coassociative, counital) over $\Bbbk\{X\}$.

Is this notion related to the previous one?

 A: Re: cographs, here is one point of view. Write $G$ for the category with two objects $0, 1$ and two morphisms $l, r : 0 \rightrightarrows 1$. Then a graph internal to a category $C$ is a contravariant functor $G^{op} \to C$, and dually a cograph internal to a category $C$ is a covariant functor $G \to C$. 
$G$ is analogous to but simpler than the simplex category, and accordingly it's reasonable to think of $1$ as an interval, $0$ as a point, and the two morphisms $0 \to 1$ as the two inclusions of the endpoints of the interval. A cograph $X : G \to C$ induces a functor
$$C \ni c \mapsto \text{Hom}(X(-), c) \in [G^{op}, \text{Set}]$$
sending each object of $C$ to a corresponding "singular graph" (analogous to the singular simplicial set, induced by the standard cosimplicial object $\Delta \to \text{Top}$), and if $C$ is cocomplete this functor has a left adjoint
$$[G^{op}, \text{Set}] \to C$$
(analogous to geometric realization) which intuitively is given by using the cograph as a notion of what points and intervals are, and gluing points and intervals together in a pattern determined by a graph in $\text{Set}$, or equivalently an object of $[G^{op}, \text{Set}]$. 
So, loosely, a cograph is a notion of what a point and an interval is in a category. From this point of view a cocategory is a notion of what a point and an interval is such that two intervals glued together at a point has something to do with an interval (this is the "cocomposition"). The corresponding "singular category" functor is what Zhen Lin describes in the comments.
Example. The point $\bullet$, the interval $[0, 1]$, and the two obvious inclusions give a "cocategory object up to homotopy" in $\text{Top}$. The corresponding "singular category" functor, up to homotopy, is the fundamental groupoid. (I'm being imprecise here; if you don't like that then ignore this example or replace it with the corresponding example in $\text{Cat}$.)
Example. Let $f : c \to d$ be a morphism in a category $C$ with finite limits and colimits. The kernel pair of $f$ (its pullback along itself) gives a diagram
$$\text{ker}(f) \rightrightarrows c \xrightarrow{f} d.$$
This makes $\text{ker}(f) \rightrightarrows c$ at least an internal graph, and I believe (but haven't checked) that by fiddling around a little you can show that it is in fact an internal category, and even an internal groupoid. Roughly speaking, it is the internal graph whose vertices are the "points" of $c$ and where there are edges between two points if they have the same "image" in $d$. 
$\text{coeq}(\text{ker}(f) \rightrightarrows c)$ is a candidate for the image of $f$ called the regular coimage. This coequalizer can and should be thought of as the "connected components" of the internal graph / category / groupoid above. 
Dually, the cokernel pair of $f$ (its pushout along itself) gives a diagram
$$c \xrightarrow{f} d \rightrightarrows \text{coker}(f).$$
This makes $d \rightrightarrows \text{coker}(f)$ at least an internal cograph, and dually I think an internal cocategory, and even an internal cogroupoid. From the point of view I described above, $d$ is the "notion of point" and $\text{coker}(f)$ is the "notion of edge," where the two morphisms $d \rightrightarrows \text{coker}(f)$ are the two inclusions of the endpoints and the glue in the middle is given by gluing along $c$. Mapping out of this guy corresponds to thinking about morphisms out of $d$ and putting edges between them when their pullbacks to $c$ agree. 
$\text{eq}(d \rightrightarrows \text{coker}(f))$ is a second candidate for the image of $f$ called the regular image. In nice categories, e.g. abelian categories, the regular coimage and regular image agree, but in general they differ. It's instructive to compute what they are in $\text{Top}$. 
This construction gets used in, among other places, commutative rings, except instead of "internal cogroupoid in $\text{CRing}$" or even "internal groupoid in $\text{Aff}$" people say Hopf algebroid. It figures in descent questions along the map $f : c \to d$. 
A: Too long for a comment, but here's an example, which is in some sense prototypical:
Consider the partially ordered sets $\mathbf{1} = \{0\}$, $\mathbf{2} := \{0<1\}$, $\mathbf{3} := \{0<1<2\}$. Note that $\mathbf{3} = \mathbf{2} \cup_\mathbf{1}\mathbf{2}$ where $\mathbf{1}$ is included, in the two copies of $\mathbf{2}$, as the last and first element respectively. There are order-preserving maps
$$
\mathbf{1} \rightrightarrows \mathbf{2} \to \mathbf{3}
$$
which are the cosource, cotarget and cocomposition respectively. The last map sends $0 \mapsto 0$ and $1 \mapsto 2$. There is also an order-preserving map $\mathbf{2} \to \mathbf{1}$, which is the co-unit map. You can check that you have co-unitality and co-associativity. So $\mathbf{1} \rightrightarrows \mathbf{2}$ is a cocategory (or more precisely a cocategory object in posets). You can also consider these posets as categories in the usual way (at most one arrow between any two objects) and get a cocategory object in $\mathbf{Cat}$.
