Consider the following Cayley Table of order $5$:
$$\begin{array}{c|ccccc}
\ast & 1 & 2 & 3 & 4 & 5\\
\hline
1 & 1 & 2 & 3 & 4 & 5\\
2 & 2 & 1 & 3 & 3 & 5\\
3 & 3 & 3 & 1 & 4 & 5\\
4 & 4 & 3 & 4 & 1 & 5\\
5 & 5 & 5 & 5 & 5 & 1
\end{array}$$
We have that $\{1,2,3,4,5\}$ is closed under $\ast$, $1$ is the identity element and every element is the unique left/right inverse of itself (see the diagonal of the table).
Moreover, this operation $\ast$ is commutative too, but not associative:
$$(2\ast 3)\ast 4 = 3\ast 4 = 4 \ne 3 = 2\ast 4 = (2\ast(3\ast 4)).$$
What's interesting is that one such structure, that
satisfies all group axioms except associativity,
is not necessarily even a quasigroup. Indeed in my example, as in the first one of two in the answer by @David, not all the rows (columns) of the Cayley Table are bijections of the underlying set: such structures are indeed not cancellative and have no division (see definitions 5 to 9 in this paper).