# How to prove if function is right or left inverse in concise manner?

Here's the question:

Let $$f: D \rightarrow Z$$ be a function.

Show that: if function $$g: Z \rightarrow D$$ is given with charateristic:

$$\forall z \in Z: f(g(z)) = z$$

then $$f$$ is surjective.

My Proof: I just tried to prove this using definition of bijection of a function.

Firstly $$\Rightarrow$$:

It is already given that $$\forall z \in Z: f(g(z)) = z$$. So that means $$g$$ is bijective. That means that $$\forall z \in Z, x \in D: g(z) = x$$. In other words every $$z$$ in Pre-Image has atmost one image in $$D$$. So it is injective. Also $$\forall x \in D$$ there exists also a Pre-Image, which means its surjective.

Now $$g$$ is bijective. That means $$f: D \rightarrow Z$$ is inverse of $$g$$.

Therefore $$f(x) = z$$ and as $$g(z) = x$$ then $$f(g(z) = z$$ is obviously true.

So we can say that $$f$$ is sujective?

Or is there any concise way of proving it?

• "It is already given that $\forall z \in Z: f(g(z)) = z$. So that means $g$ is bijective".This statement is false,this means only that $g$ is injective. Commented Nov 8, 2022 at 11:02
• Then how come does $g$ have inverse $f$? Commented Nov 8, 2022 at 22:56
• What is truly strange about this problem: Here is a real and complete proof that $f$ is surjective: "$\forall z \in Z, f(g(z)) = z$, thus $f$ is surjective." Commented Nov 9, 2022 at 1:25

$$f$$ is bijective.
$$g$$ is bijective because
$$∀𝑧∈𝑍:𝑓(𝑔(𝑧))=𝑧$$
so that means there for every $$x \in D$$ there exists one and only one $$z \in Z$$ for function $$f$$. Other way round, for all $$z \in Z$$ there exists pre-Image in $$x \in D$$.
• Consider: $Z = D = \Bbb R$, \begin{align}f(x) &= \begin{cases}0,& x =k\pi\text{ for some }k \in \Bbb Z\\\cot x,&\text{otherwise}\end{cases}\\g(x) &= \text{Arc}\,\text{cot } x\end{align} $f(g(x)) = x$ for all $x \in \Bbb R$, but $f$ is not a bijection, and neither is $g$. Commented Nov 9, 2022 at 1:14