I am having a hard time wrapping my head around the logic behind a proof to a problem in Velleman's "How to Prove It." I feel I've found a logical error due to the problem not being specific enough. Note there is no official solution to this problem so what I have thus far is the best I've been able to come up with.
The problem:
Suppose $f: A\rightarrow B$ and $g:B\rightarrow C$. Prove that if $f$ is onto and $g$ is not one-to-one, then $g \circ f$ is not one-to-one.
My proof:
Suppose $f$ is onto and $g$ is not one-to-one. If $g$ is not one-to-one, then $g(y_1)=g(y_2)$ and $y_1\neq y_2$. Hence $(y_1,g(y_1)=g(y_2))$ and $(y_2,g(y_1)=g(y_2))$ are elements of $B\times C$. If $f$ is onto then $\forall y\in B\exists x\in A(g(x)=y)$. It follows that $(x,y_1),(x,y_2)\in A\times B$.
This is where I am lost. If I continued the proof with what I have, I would only prove that $(x,g(y_1)=g(y_2))\in A\times C$, which says nothing about whether or $g \circ f$ is one-to-one. Such an approach would only work if I let the $x$-values in my last part be unique. In fact, this is what others who have posted solutions on the internet did to complete the proof. This leads me to my problem and the possible logical error: $f$ being onto says nothing at all about its input values having unique corresponding output values. In fact, as best as I can tell, it's equally possible for the function $f$ to have $x$-values such that $(x,y_1),(x,y_2)\in A\times B$ (i.e. the same $x$-value) or $(x_1,y_1),(x_2,y_2)\in A\times B$ $\land$ $x_1 \neq x_2$ (i.e. unique $x$-values, the technique others have used). I cannot assume one or the other without more information. Am I missing something or are the instructions in this problem incomplete?
You may have made your life too complicated. You are also disregarding that $g$ and $f$ are functions: necessarily, this means that any given input value can only have one output value.
Because $g$ is not one-to-one, there exist $b_1,b_2\in B$, $b_1\neq b_2$, so that $g(b_1)=g(b_2)$.
Because $f$ is onto, there are $a_1,a_2\in A$ such that $f(a_1)=b_1$ and $f(a_2)=b_2$. Note that, necessarily, $a_1\neq a_2$: otherwise, $a_1=a_2$ implies $b_1=f(a_1)=f(a_2)=b_2$, contradicting the fact that $b_1\neq b_2$.
But, we then have $$ g\circ f(a_1)=g(b_1)=g(b_2)=g\circ f(a_2), $$ proving that $g\circ f$ is not one-to-one.