# Let $f,g,h$ functions, how to prove or refute if $f=g$ then $h\circ f=h\circ g$

First, i define the sets of the functions $f:A \rightarrow B,g:A \rightarrow B, h:B \rightarrow C$.

Let $z \in C$, by the definition of the function $(h\circ f)$, $\exists x;$

$z=(h\circ f)(x)\implies z=h(f(x))\implies z=h(g(x)) \implies z=(h\circ g)(x)$

Then $(h\circ f)=(h\circ g)$.

Is my show okay?

• Why start at $z\in C$? Better say, let $x\in A$. Then show that $$(h\circ f)(x)=(h\circ g)(x).$$ – Juniven Mar 7 '17 at 1:08
• If f=g , h o f is h o g . – Jacob Wakem Mar 7 '17 at 1:47

I think this is just about right, except you should instead show this statement for all $x$. I.e. $\forall x\in A$ $$(h\circ f)(x)=h(f(x))=h(g(x))=(h\circ g)(x)$$ so, $h\circ f=h\circ g$ as functions. Also, you should be careful: there does not necessarily exist an $x$ such that $(h\circ f)(x)=z$, because we don't know that $h\circ f$ is surjective. Instead, for all $x$, there exists a $z$ such that $z=(h\circ f)(x)$.