How to calculate inverse function of a "weird" function like $y=x+\cos x$ As the title said, how to calculate the inverse function of $y = f(x) = x + \cos x$ ?
I found a super function $x = g(y)$ like this:
$x = y -\cos(y-\cos(y-\cos(y-cos(...(y-\cos y)...))))$, with infinite nested loop.
And I use matlab to test it, find that the more nests, the lower approximation error.
So I'm conjecturing if $g(y)$ is the true inverse function of $f(x)$.
If yes, why? And can we reduce the form into some "simpler" finite style?
If not, what should it be? And also why?
###############
Note of changes: Sorry for my poor math knowledge, I cannot find a proper symbol describe what "..." exatly means. how about I use programming language?
y = a; % a is a constant    
x = y - cos(y);
for i = 1:10000
   x = y - cos(x);
end
disp(x)


The sequence in your code is defined by $x_0 = a$ and $x_{n+1} = a - \cos(x_n)$, and you want to set $g(a) = \lim_{n \to \infty} x_n$. Assume for the moment that the limit exists.  Then of course the limit of $x_{n+1}$ is also $g(a)$, so taking the limit of both sides of $x_{n+1} = a - \cos(x_n)$ gives $g(a) = a - \cos(g(a))$, or $g(a) + \cos(g(a)) = a$, or $f(g(a)) = a$.  That is what we would expect for the inverse of $f$, so this is promising.
To complete the proof you must check 2 more things: (1) that the limit exists, and (2) $g(f(a)) = a$ as well.
