# Replace inverse function

I'm solving an expression like so:

Solve[u[x] == u[a] + u[b], x]


Mathematica returns

{{x->(u^(-1))[u[a]+u[b]]}}


If I now specify the function u more precisely, via

% /. {u[x_] -> x}


what I get is

{{x->(u^(-1))[a+b]}}


i.e. Mathematica replaces the function but not its inverse. Is there any way of replacing the inverse appropriately as well?

-

You need to replace function u with your definition, not only the u[x] symbol. Defining u as a function solves the problem
Solve[u[x] == u[a] + u[b], x] /. {u -> Function[x, x]}