Disprove: $f\circ g = f \circ h \implies g=h$ for a surjective function $f$ I tried using a very specific counterexample here where I select a surjective function for which the compositions are equal but the functions within are not.
This is probably off-base, but it's what I've got so far. 

Assume $f \circ g = f \circ h$.
Consider the surjective function $f:\mathbb{R} \rightarrow \mathbb{R}$ given by $f(x) = x*sin(x)$.

Should I prove this is surjective before proceeding?

Suppose for the sake of contradiction that $g \neq h$ given by
$g(x) = 0$ and $h(x) = 2\pi$.

Can I choose these constant functions? Do I need to define domains and codomains?

$(f \circ g)(x) = f(g(x)) = f(0) = 0 * sin(0) = 0$
$(f \circ h)(x) = f(h(x)) = f(2\pi) = 2\pi * sin(2\pi) = 0$
Observe that $f \circ g = f \circ h$ $\land$ $x_1 \neq x_2$.
Thus we have given a counterexample to disprove the statement. Thus surjectivity of $f$ is not a sufficient condition for the statement to be true.

I understand the proof completely now and understand I have it correct, thank you for your responses.

Let $S$ be the set of students of  a class. Let $g(s)$ and $h(s)$ denote the scores obtained by student $s$ in Geography and History respectively.
Thus $g,h$ are functions from $S$ to $[0,100]$. Let $f\colon[0,100]\to \{A,B,C,D,E,F\}$ be a function that assigns letter grades to numerical scores.
Now I leave it to you work out a scenario where each student gets the same grade in both the subjects, that is, $f\circ g = f\circ h$. Does that necessarily mean the scores are same in both the subjects for each student?
