If the kernel (cokernel) of a morphism $f$ is trivial, then is $f$ injective (surjective), or mono (epi)? Define a monomorphism (epimorphism) as a left-cancellative (right-cancellative) morphism, in some category.
The Wikipedia page on cokernels says that a morphism is injective (surjective) iff its kernel (cokernel) is trivial. The category being discussed seems to be that of vector spaces.
Now, in many categories, being an injection (surjection) is equivalent to being a monomorphism (epimorphism), but, if this is not the case --ie. monomorphisms are not injective (epimorphisms are not surjective)--, does the above result generalize to such monomorphisms (epimorphisms)?
Namely, is the following true? A morphism is a monomorphism (epimorphism) iff its kernel (cokernel) is trivial.
 A: As Qiaochu notes, kernels and cokernels don't make sense in an arbitrary category: you need a zero object to even define what these should be (and even with a zero object, they aren't guaranteed to exist).
If you have a category with a zero object, then a monomorphism $f$ has zero kernel: $f\circ\ker f = 0 = f\circ 0\implies \ker f = 0$. This doesn't show that the kernel actually exists, just that if it does, it must be equal to zero. However, it is not difficult to verify that $0$ satisfies the universal property of the kernel in this case. Reverse all the arrows to get the dual statement for cokernels.
However, the converse is false: consider the category with four objects $A$, $B$, $C$, and a zero object $0$ and morphisms
\begin{align*}
\operatorname{Hom}(X,X) &= \{0, id_X\}\quad\textrm{for each object }X\\
\operatorname{Hom}(B,C) &= \{0, f\}\\
\operatorname{Hom}(A,B) &= \{0,g,h\}\\
\operatorname{Hom}(A,C) &= \{0, fg = fh\}\\
\operatorname{Hom}(C,A) &= \operatorname{Hom}(C,B) = \operatorname{Hom}(B,A) =\{0\}.
\end{align*}
By construction, $g\neq h$, $fg = fh$, and you can verify that $\ker f$ exists and is equal to $0 : 0\to X$.
A: I just wanted to supplement the existing answer to this question with another example of a category with a zero object and kernels, where a morphism with trivial kernel need not be monic. The category I have in mind is the category $\mathbf{Set}_*$ of pointed sets, whose objects are sets $X$ with a labelled element $*\in X$, and morphisms are functions that preserve the labelled element. This category has a zero object as well as kernels (in fact, all limits and colimits). The zero object is the singleton set $\{*\}$, and the kernel of a morphism $f\colon X\rightarrow Y$ is the preimage of $*\in Y$, with its labelled element being the same as in $X$. The monomorphisms in $\mathbf{Set}_*$ are exactly the injective functions.
Morphisms in $\mathbf{Set}_*$ with trivial kernel need not be monic. The simplest example is to take the function $f\colon\{*,x,y\}\rightarrow\{*,z\}$ sending $*$ to $*$ and $x$ and $y$ to $z$. This has trivial kernel but is not monic.
