I'm glad you brought up that example, Vladislav Papayan! It's only for f(x)=2x that the left and right adjoints fit so snugly together.

Of course it's not the case that f and g have to be inverses of each other, but they have to be a little more like inverses than your g establishes.