Composite function proofs Prove that this is incorrect


*

*$g \circ f$ is surjective, but $g$ is not surjective.

*$f$ and $g$ are not injective, but $g \circ f$ is injective.
I know these both don't exist but, I don't really know how to formally prove them. Do I use proof by contradiction?
My attempt:


*

*We know $g \circ f$ is surjective and we want to show that $g$ is surjective.
Let $y \in\mathbb R$. since $g \circ f$ is surjective, there exists an $b \in \mathbb R$ such that $g(f(b)) = y$. We set $c = f(b) \in\mathbb R,$ then $g(f(b))=g(c)=y$. So $g$ is surjective.


Is this how you're suppose to prove the question? I feel like I just proved that $g \circ f$ is surjective then $g$ is surjective but not the question above.


*I don't really know where to start with this one. Am I suppose to use proof by contradiction here?

 A: For part 2, since $f$ is not injective, $\exists x,y \in \mathbb{R}$ with $x \neq y$ such that $f(x) = f(y)$. Then $(g \circ f)(x) = (g\circ f)(y)$.
Your proof of part 1 is correct. Since $g\circ f$ surjective $\implies$ $g$ surjective, there is no example of $g$, $f$ where $g \circ f$ is surjective, but $g$ is not.
Edit: Since $f(x)=f(y)$, we have
$$(g\circ f)(x) = g(f(x)) = g(f(y)) = (g \circ f)(y).$$
Since $x \neq y$, it follows that $g \circ f$ is not injective.
A: In general, it is simple to show "that such examples do not exist."
If someone asks you to show that:

examples of the set $A$ do not exist

then simply prove:

$A$ is the empty set. 

Alternatively, suppose that that someone says,   

Show that there are no examples of $x$ in $S$ such that $P(x)$, where $P(x)$ is some statement about $x$.

You are being asked to show:    

not $[\exists x \in S$ such that $P(x)]$

That's very simple. Just prove:

$\forall x \in S$, not $P(x)$

A: If $gf$ is surjective then $$\Bbb R=\{(gf)(x):x\in \Bbb R\}=$$ $$=\{g(f(x)):x\in \Bbb R\}=$$ $$=\{g(y):y\in \{f(x):x\in \Bbb R\}\}\subset$$ $$\subset \{g(y):y\in \Bbb R\}\subset \Bbb R.$$ So $\Bbb R\subset \{g(y):y\in \Bbb R\}\subset \Bbb R.$
So $\{g(y):y\in \Bbb R\}=\Bbb R.$
