TITLE: Can you, given any semigroup, define an identity element to make it a monoid
QUESTION [7 upvotes]: I'm wondering if I can "make up" an identity element, like so:
I can define an element I such that any element x + I is equal to x, i.e.: I can redefine my set as [the old set] union with {I}, and redefine my binary operation such that if one of the operands is I, then the result is the other operand. Then I will have an identity element.
For example, imagine the set of integers greater than 100 and addition; this forms a semigroup but has no identity. I can define a new element I (it doesn't have any "numerical value" but it doesn't need to). Then I say 100 + I = 100, 101 + I = 101, etc. Of course, I wouldn't be able to do multiplication or take the square root of I, but those operations aren't a part of my semigroup anyways.

REPLY [8 votes]: Yes, you can always do it!
Suppose $(S, .)$ is a semigroup (i.e., $.$ an associative binary operation). Then consider the set $S'=S\cup\{*\}$ together with the binary operation $.'$ satisfying

$a.'b=a.b$ for all $a, b\in S$
$a.'*=*.'a=a$ for all $a\in S$
$*.'*=*$

Now, it is an easy exercise to prove $(S', .')$ is a monoid, and the obvious inclusion mapping $\iota : (S, .)\to (S', .')$ with $\iota(a.b)=a.'b$ is a semigroup homomorphism.
Also, you can go a bit further and notice this semigroup homomorphism is universal in the sense that any semigroup homomorphism $\varphi: S\to M$ to a monoid $M$, there is a unique monoid homomorphism $\varphi': S'\to M$ such that $\varphi=\varphi'\iota.$ Pictorially,

The natural mathematical domain that discusses this type of construction is "category theory", but I will not go into details.