Definition of a category as a monoid This is my first time writing here. If you want me to write my questions in another way, please let me know because I have no experience in doing that at all.

I am using the book of MacLane introducing the concept of categories.

Let $O$ be a set of objects and $A$ a set of arrows.

A category can be seen as a monoid $(A, \circ)$ by using the following “product over the set O” which is the set of all composable pairs $$A \times_O A = \{\langle f,g \rangle : f,g \in A \text{ with } dom(g) = cod(f) \}.$$

As set we do have the set of arrows. As inner binary operation we do have the composition $\circ$. Associativity is given by the common definition of a category (MacLane).

I would like to show properly the condition of the existence of the neutral element. We know that there exists for each arrow $f: a \to b$ the identity arrows $id_a$ and $id_b$ so that $$f \circ id_a = id_b \circ f = f.$$ But it should be rewritten in a way so that it makes sense with the definition of a neutral element and we can write a real triple $(A,\circ, e)$.

Could you give me some hints? Thank you in advance.
In one line, what MacLane is saying is that (small) categories are monads in the bicategory of spans of sets.

More precisely: monoids are a notion that makes sense in any monoidal category. Fix the set $O$ and consider the category $\mathbf G_O$ whose objects are the triples $(A,s,t)$ with $s,t$ maps $A \to O$ and whose mrophisms $(A,s,t) \to (A',s',t')$ are the map $F:A \to A'$ such that $s=s'F$ and $t=t'F$. Then there is a monoidal product on $\mathbf G_O$ defined as:
$$ (A,s,t) \otimes (A',s',t') := (\{(f,f') \in  A\times A' : t(f) = s'(f')\}, (f,f')\mapsto s(f), (f,f') \mapsto t'(f')) $$ 
The unit for this monoidal product is $(O,\mathrm{id}_O,\mathrm{id}_O)$. The claim is that a monoid in this monoidal category $\mathbf G_O$ is precisely a (samll) category with set of objects $O$. In particular, the unit of such a monoid is expressed as a map $e : (O,\mathrm{id}_O,\mathrm{id}_O) \to (A,s,t)$ in $\mathbf G_O$, meaning a map $e:O \to A$ such that $s=se$ and $t=te$.
Interesting question, I never realised we could see a category in this way!

Before I answer your question, let me first point out where in MacLane's Categories for the Working Mathematician the relevant definitions can be found (in case anyone else is interested). Page 10 defines the sets $O$, $A$ and the product $A \times_O A$, together with how these sets with the necessary operations form a category. Earlier, in the introduction, on page 2 it is explained what a monoid is in terms of diagrams (with their usual meaning, with respect to the cartesian product $\times$). Then on page 4 it is explained how we can replace the usual cartesian product $\times$ by a similar binary operation $\square$.

The question is then: given a category with $A$ and $O$ as its set of arrows and objects respectively, in the case where this operation $\square$ is given by $\times_O$, what is the neutral element for the monoid $(A, \circ)$?

For any such operation $\square$, the neutral element will be given by an arrow $1 \to A$, where $1$ is the unit of the operation $A \square A$. That is, for all objects $X$, we must have isomorphisms
$$
1 \square X \cong X \cong X \square 1.
$$
Note that if $\square$ is the cartesian product $\times$, then 1 is just a singleton and an arrow $1 \to A$ just amounts to an element of $A$. So this is why we usually think of it as just an element. For other operations than the cartesian product, the unit may be something more complex than just a singleton and we get a 'neutral element' that is no longer just an element.

One of these more complex cases is where $\square$ is $\times_O$. First let us determine the unit. I will denote the unit of this operation by $I$ to avoid confusion in notation. So we want some set $I$ such that for all $B \subseteq A$ ($\times_O$ is only defined on subsets of $A$), there are isomorphisms:
$$
I \times_O B \cong B \cong B \times_O I.
$$
It turns out that taking
$$
I = \{ id_a : a \in O \}
$$
will do the job (check this!).

Now the 'neutral element' (which is no longer just one element) will be given by an arrow $I \to A$. There is only one, very natural, choice here and that is the inclusion. You should check that this indeed makes the entire construction into a monoid. So the 'neutral element' is now actually a subset of $A$.