Let me start with a remark : to check whether a given [EDITED for clarity after Andrew's comments]. Given $h:X\to Y$, the following are equivalent:
(1) $h$ is the coequalizer of some $W\rightrightarrows X$you can forget about the particular ,
(2) $W$, because you can then take h$ is the coequalizer of $W=X\times_Y X\times_Y X\rightrightarrows X$with the two projections.
In other words, being a coequalizer is equivalent to being an effective epimorphism (This works in any category with fiber products).
Back to the questions. Question (b) asks whether if $h$ is a coequalizer, then its restriction $h^{-1}(V)\to V$ also is, for each open $V\subset Y$. Let me recall the example I gave to answer this question, which provides a counterexample where $h^{-1}(V)$ is empty (and $V$ isn't): take $Y=\mathrm{Spec}\,k[[t]]$ ($k$ a field), $X=$ the disjoint sum of all subschemes $\mathrm{Spec}\,(k[[t]]/(t^n))$ ($n\geq1$), $V=$ generic point of $Y$.
For question (a), assume each $h_i:X_i\to Y_i$ is a coequalizer and let $s:X\to S$ be a morphism such that $sf=sg$. Then for each $i$, the restriction of $s$ to $X_i$ descends uniquely to $t_i:Y_i\to S$. The question is whether $t_i$ and $t_j$ coincide on $Y_i\cap Y_j$. Composing them with (the restriction of) $f$ (or $g$) gives the same result, hence:
$\bullet$ gluing is automatic (and we get a positive answer) if we know that for each open $V\subset Y$, the restriction $h^{-1}(V)\to V$ is an epimorphism of schemes;
$\bullet$ but the above example shows that this is not true in general, and in fact we get a (nonseparated) counterexample to the question by taking two copies $X_i\to Y_i$ ($i=1,2$) of that example and putting $X=X_1\coprod X_2$, $Y=$ gluing of $Y_1$ and $Y_2$ along the generic points: here the coequalizer of $X\times_Y X\rightrightarrows X$ is $Y_1\coprod Y_2$.

