Functions – Proving a Function is Onto with Composite Functions

functionsrelations

I am very confused as to whether we can use $f[g(x)]$ and $g[f(x)]$ to show that a function is onto.

Let's say I have a function :

$y = f(x) = x + 1$
from $\mathbb R \to \mathbb R$

Is it possible that if I find $f[g(x)]$ and $g[f(x)]$ and they give one $y$ and one $x$ (i.e., $f[g(x)] = y$ and $g[f(x)] = x$)
then my function will be onto?

Sometimes this method did worked but other times even though I got one $y$ and one $x$, the function turned out to be not onto.

Kindly explain.
Thanks

Best Answer

If $f\circ g$ is "onto" (surjective), then $f$ must be onto.

Proof: Let $f:X\to Y, g:Z\to X$, and suppose $f\circ g$ is onto. Let $y\in Y$ be an arbitrary element. As $f\circ g$ is onto, then there is $z\in Z$ such that $(f\circ g)(z)=f(g(z))=y$. But then $f(x)=y$ if you set $x=g(z)$. In other words, for every $y\in Y$ you can find $x\in X$ such that $f(x)=y$. This proves that $f$ is onto.