I was told that identity functions have the definition when followed.

If f ∘ e = f, e = idx. If e ∘ f = f, e = idy.

The textbook had a question below the definition asking, for any functions f and g, does either of g ∘ f = idx, f ∘ g = idy implies the other.

My answer was,

f ∘ g = idy

f ∘ g ∘ f = idy ∘ f = f

f ∘ (g ∘ f) = f

(g ∘ f) = idx (from the definition of f ∘ e = f, e = idx)

and similarly

g ∘ f = idx

f ∘ g ∘ f = f ∘ idx = f

(f ∘ g) ∘ f = f

(f ∘ g) = idy (from the definition of e ∘ f = f, e = idy)

But the answer was, no they do not imply the other and it didn't give me the proof, but showed a counter example.

counter example

Okay, I understand the counter example, but where in my proof has gone wrong? I didn't assume anything, just followed definition in the proof.

Edit: The text book says, (translated)

Let's figure out whether identity and inverse elements exist for composites. The identity element is a function e that satisfies, f ∘ e = e ∘ f = f for all f: X->Y. However, the function that satisfies f ∘ e = f is e: X->X, and the function that satisfies e ∘ f = f is e: Y->Y and hence they are different. Therefore, identity element of composites does not exist nor the inverse element. Despite this, we define the function e that satisfies f ∘ e = f as the identity function of X and write as id_X, and the function e that satisfies e ∘ f = f as the identity function of Y and write as id_Y. For each set, there exists one identity function.

Edit2: updated some lines for readability

  • $\begingroup$ Who told you that definition? It's totally wrong... $\endgroup$ – Eric Wofsey Jul 14 '18 at 22:11
  • $\begingroup$ @EricWofsey in a textbook I am using. What is correct then? $\endgroup$ – Seung Jul 14 '18 at 22:23
  • $\begingroup$ If $f(x) = x^2$ and if $e(x) = -x$ then $f\circ e(x)= f(-x) = (-x)^2 = x^2 = f(x)$. So does that mean $e$ is the identity function? Are different functions supposed to have different function because if $g(x) = e^x$ then $g\circ e(x) = e^{-x} \ne g(x)$. Are some functions supposed to have more than one identity function. .... (In short I think either the book or you screwed up on the definition. That is not the definition but it is a consequence. $\endgroup$ – fleablood Jul 14 '18 at 22:24
  • 1
    $\begingroup$ Usually the identy function is simply defined as $e: x\mapsto x$ for all $x$ in the domain. $\endgroup$ – fleablood Jul 14 '18 at 22:25
  • 1
    $\begingroup$ Is this an abstract algebra text book? Are there any restrictions on the functions? Are they all 1-1 and onto. Do they all have the same domains and codomains. You define $Id_X=e$ as the function where $f\circ e = f$. Is that supposed to be true for all $f$. Has it been proven there is such a function? That it is unique? This is just too.... strange.... without context. $\endgroup$ – fleablood Jul 14 '18 at 22:36

The problem is that you have no justification for jumping from$$f\circ(g\circ f)=f\implies g\circ f=\operatorname{id}_X,\tag1$$to $g\circ f=\operatorname{id}_X$. In fact, if $f$ was injective then, yes, you could deduce that $(1)$ hods, but all that you can deduce from $f\circ g=\operatorname{id}_Y$ is that $f$ is surjective, not that it is injective.

  • $\begingroup$ f∘(g∘f)=f is in a from of f ∘ e = f isn't it? So from the definition I am given, g∘f = e = idx. $\endgroup$ – Seung Jul 14 '18 at 22:25
  • $\begingroup$ I have no idea about what you mean with “is in a form of”. Yes, $f\circ\operatorname{id}_X=f$, but what you asserted was that $f\circ(g\circ f)=f\implies g\circ f=\operatorname{id}_X$, without justification. $\endgroup$ – José Carlos Santos Jul 14 '18 at 22:30
  • $\begingroup$ Okay if I say h = g o f, f o (g o f) = f becomes f o h = f. What I am saying is that this is the definition of idx I am given. f o e = f, e = idx. So f o (g o f) = f, (g o f) = idx. Sorry for the unbearable readability here. $\endgroup$ – Seung Jul 14 '18 at 22:35
  • 1
    $\begingroup$ Yes, $\operatorname{id}_X$ is the only function from $X$ into itself such that for every $f\colon X\longrightarrow Y$, $f\circ\operatorname{id}_X=f$. But for a specific $f\colon X\longrightarrow Y$ there may be other functions from $X$ into itself (besides $\operatorname{id}_X$) with the same property. $\endgroup$ – José Carlos Santos Jul 14 '18 at 22:41
  • $\begingroup$ For the first line of your comment: Are you saying the id_X is universal? For all functions, they have the same id_X? I thought id_X is a property of a function. Second line: That means there may exist multiple functions e that satisfies f o e = f. Are those other functions not identity functions then? Only the universal id_X is the identity function? $\endgroup$ – Seung Jul 14 '18 at 23:04


You have two sets, $X$ and $Y$ and a class of functions that map $X \to Y$. They want to know if there is a function $id$ so that $id\circ f = f\circ id = f$ for any $f: X\to Y$.

I'm actually not sure why they even bothered to ask as the $id\circ f = f$ would require that $id: Y\to Y$ and $f\circ id = f$ would require $id:X\to X$ which is impossible as $X$ and $Y$ are different sets.

However then it asks if there are $id_X: X\to X$ that can act as a right identity with $f\circ id_X = f$ for all $f:X\to Y$. The answer is, yes, the identity element $i:X\to X$ where $i(x) = x$ for all $x \in X$ is such an element and with a little bit of playing it's clear that that is the is the only such function from $X \to X$.

(If $h(x) = w \ne x$ then there is some function $f$ where $f(w) \ne f(x)$ and so $f(h(x)) = f(w) \ne f(x) $. So the only function that works is $i(x) = x$.)

Likewise $i:Y\to Y$ $i(y) = y$ can act as $id_Y: Y\to Y$ that can act as a left identity with $id_Y\circ f = f$ for all $f: X\to Y$.

So they are asking if you have a $g:Y\to X$ so that $g\circ f: X\to X = id_X$ or $f\circ g: Y\to Y= id_Y$ does one imply the other.

And the answer is no.

The thing is if $|X| > |Y|$ then $f: X \to Y$ can not be injective so there must be $w\in X,x \in X$ and $w\ne x$ so that $f(x)=f(w)$. $g\circ f:X\to X$ can't be $id_x$. $id_X(w) = w$ and $id_X(x) = x$ but $g\circ f(w) = g(f(w)) = g(f(x)) = g\circ f(x)$.

  • $\begingroup$ The question does not specify anything about function f or g. The answer, however, is given as a counterexample that uses f: X->Y, g: Y->X. With regards to your answer, I am trying to understand. $\endgroup$ – Seung Jul 14 '18 at 23:37
  • $\begingroup$ I think this link has something to say with regards to identity element and identity function. en.wikipedia.org/wiki/Identity_function#Algebraic_property. $\endgroup$ – Seung Jul 14 '18 at 23:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.