Let $f:X\to Y$ be any function. Prove that if $h$ is a left inverse of $f$ and $k$ is a right inverse of $f$ then $h=k$
I was thinking of saying that: if $h$ is the left inverse that means $(h\circ f)(x)=id_x$ and if $k$ is the right inverse then $(f\circ k)(x)=id_y$.
Therefore, $(h\circ f)(x)=(f\circ k)(x)$. But how can I prove further that $h=k$? Any ideas?