@Igor – it strikes me that we don't really need the bit about \\(g\\) being a right inverse.

It's enough for \\(g\\) to be a left inverse and \\(h\\) to be a right inverse.

Then we have \\(g = g\circ(f\circ h) = (g\circ f)\circ h = h\\).

It's enough for \\(g\\) to be a left inverse and \\(h\\) to be a right inverse.

Then we have \\(g = g\circ(f\circ h) = (g\circ f)\circ h = h\\).