Finding the limit of a diagram I'm new to category theory and I'm trying to understand (and then hopefully solve) the following problem:
Express the limit of the diagram in terms of products and equalizers
$\require{AMScd} \begin{CD}
A @.D\\
@A{f}AA @V{h}VV\\
B @>{g}>> C \\
\end{CD}$
In theory I know the definitions involved, but I'm still struggling to understand the connection between a drawn diagram and the formal definition of it as a functor. I've read the wiki and other questions here (notably Category theory - what's the intuition behind diagrams? ), but what exactly is asked of me in the task is still hard for me to grasp.
So basically as I understand a diagram is any functor between categories $J$ and $A$, we usually say $J$ encodes the "shape" of a diagram and the functor $F$ transfers it into $A$ and in some sense preserves the structure. Since we have a definition of a limit for arbitrary functors, we can talk about limits of diagrams.
Now what is unclear to me is when we draw a diagram in a colloquial sense, so one like in my post, how exactly does it correspond to the definition? I thought a graph like this is supposed to represent a category. Is it supposed to be a concise way of presenting $J$? Is this the image of $J$ in $A$? Also as far as I know a drawn diagram can represent different categories (since we don't specify in the drawing how compositions of morphisms behave), so how can we deduce from it anything about limits?
 A: As I mentioned in the comments, some authors, such as Barr and Wells in Toposes, Triples, and Theories, view a diagram as a homomorphism from a graph, or, to be precise, a directed multigraph which categorists often call a quiver. For at least small categories we have an underlying quiver whose vertices are the objects and edges are the arrows. For a small category $\mathbb C$ call the underlying quiver $|\mathbb C|$. This is functorial, i.e. a functor $G:\mathbb C \to \mathbb D$ gives rise to a quiver homomorphism $|H|:|\mathbb C|\to|\mathbb D|$. The functor $|{-}|:\mathbf{cat}\to\mathbf{Quiv}$ has a left adjoint, which means that given an arbitrary quiver $G$, we can make a small category $FG$, the free category generated from the quiver $G$, such that a quiver homomorphism $G\to |\mathbb C|$ is essentially the same thing as a functor $FG\to\mathbb C$. The free category generated from a quiver is what you'd expect. For example, say you said you had the following category: $$\require{AMScd}
\begin{CD}A@>f>>B@>g>>C@>h>> D\end{CD}$$
Some wise guy in the audience is going to say "that's not a category". The wise guy is, of course, right. Your "category" lacks identity arrows as well as arrows corresponding to the composites $g\circ f$, $h\circ g$, and $h\circ g\circ f$. You respond, "all of that was implied". In other words, you sketched a quiver and were referring to the category freely generated from the quiver which adds in these "implied" arrows.
So if we view a diagram as a quiver homomorphism into the underlying quiver of a category, then the adjunction above states that we can just as well view it as a functor from the free category generated by a quiver into a category.
Now, the idea is that we can consider arrangements of objects and arrows in a category as a "diagram" in the colloquial sense, and this is the idea behind the quiver homomorphism approach. Nevertheless, it's important that it is not the image of the quiver homomorphism that's the diagram. It's often presented that way, but the intent is that you use the visual position as an indicator of which "spot" or "label" that occurrence of the object has. This is clearest when considering (co)products. A product of $n$ objects is the limit of a diagram with $n$ vertices and no edges. However, we can talk about the product of an object with itself, e.g. $A\times A$, and that's clearly a very different thing than $A$. We need the mapping from vertices to objects so we can talk about the "second object" say, even when the "first" and "second" object happen to refer to the same object.
Turning to your particular example, your diagram has no composable arrows so the free category generated from it is just the same except with identity arrows added. There's a general result that every (finite) limit can be constructed as an equalizer of (finite) products. I suspect this result has been covered or at least mentioned and the exercise is to apply that result to this example. One perspective on this is to think of a limit as a solution to a system of equations. You have an object $L$ which is the putative limit, and you have for each vertex of the diagram, $v$, an arrow $p_v:L\to D(v)$. For your particular diagram, you have the equations $p_A = f \circ p_B$, $p_C = g \circ p_B$, and $p_C = h \circ p_D$. The core insight to the general problem of rewriting a limit to an equalizer of products is can you find an $r$ and an $s$ such that the solution of the equation $r\circ p = s \circ p$ is the same as the solution to the system of equations you started with? Here, we have an $L'$ and an $p : L' \to {?}$ and the goal is to choose $r$ and $s$ in such a way that $L'$ is also a limit to the original diagram. If it helps, you can consider how you'd do it in the category of sets and functions. Not only should you be able to generalize your solution there to an arbitrary category, but the general problem actually reduces to the problem in $\mathbf{Set}$.
