# Proving the set of functions from $\mathbb{R}$ to $\mathbb{R}$ form a semigroup under composition

Let $F=\{f\colon\mathbb{R}\to \mathbb{R}\}$. Show that $F$ is a semigroup under function composition. Is it a monoid? Is it a group? Is it Abelian?

I know how to show that if $f,g,h$ are in $F$ then $F$ is associative and I can show that $F$ has an identity element with $g=x$ such that $f(x)(g)=(g)(f(x))=f(x)$. I'm not sure how to show if $F$ is a group or not. How do I show that every element of $F$ has an inverse?

-

First:

I know how to show that if $f,g,h$ are in $F$ then $F$ is associative

That sentence does not make sense. The conclusion, "$F$ is associative" is unconnected to the premise, "if $f,g,h$ are in $F$." The fact that the premise introduces notation for three things that are never again mentioned ($f$, $g$, and $h$) should tell you that there is something very wrong with that sentence.

Moreover, "associative" is a property of binary operations, not of sets. So $F$, which is not an operation, cannot "be associative."

What you need to show is that function composition is associative; that is, you need to show that if $f$, $g$, and $h$ are functions that can be composed, then $(f\circ g)\circ h = f\circ (g\circ h)$ as functions.

Then you need to show that $F$ is closed under function composition; that is, that if $f$ and $g$ are elements of $F$, then we can compute $f\circ g$ and $f\circ g$ will also be in $F$.

Those two things will show that $F$ is semigroup under function composition.

If your definition of "semigroup" requires your set to be nonempty, then you may also want to show that $F$ is nonempty by explicitly exhibiting an element of $F$.

Second:

I can show that $F$ has an identity element with $g=x$ such that $f(x)(g)=(g)((f(x))=f(x)$.

Again, this is rather badly written to the point of unintelligibility (though one can guess what you meant to write, what you actually wrote is nonsense). $g=x$ does not describe a function. If you want to describe a function, you'll want to say "the function $g\colon \mathbb{R}\to\mathbb{R}$ defined by the rule $g(x)=x$ for all $x\in \mathbb{R}$" or words to that effect. Also, "$f(x)(g)$" is nonsense as written, as is $(g)(f(x))=f(x)$. Instead, what you need to show is that $f\circ g = f$ and $g\circ f = f$ for all $f\in F$. That amounts to showing that for every $x\in\mathbb{R}$ $(f\circ g)(x) = f(x)$ and $(g\circ f)(x) = f(x)$.

Thirdly: assuming you have successfully done that, then think about what it would mean for a function $f$ to have an inverse. Inverse of what kind? Inverse with respect to composition. So a function $f\colon\mathbb{R}\to\mathbb{R}$ has an inverse in $(F,\circ)$ if and only if there exists $h\colon\mathbb{R}\to\mathbb{R}$ such that $$h\circ f = g = \mathrm{id}_{\mathbb{R}}\quad\text{and}\quad f\circ h = g = \mathrm{id}_{\mathbb{R}}.$$ Now, do you know any properties that a function must satisfy in order to have an inverse in the sense of composition? Can you produce a function from $\mathbb{R}$ to itself that does not have those properties, and therefore is not invertible? If so, what do you conclude?

-
Thank you for clearing that up. I will be more careful in my writing next time. – user23793 Feb 21 '12 at 20:59

If you mean that set of real-valued functions on $\mathbb{R}$, then there aren't inverses for everything. In order to have an inverse, a function must be injective. So, $f(x)=\sin(x)$, has no compositional inverse.

-
Or just take a constant function. – Qiaochu Yuan Feb 21 '12 at 20:20

It will be mono id as identity function will work as identity element. Since every function wont have inverse only bijection function will do the job.I hope you can find a non-bijective function which does not have any inverse.

-