Let n1and n2 be two distinct elements of W.
To Prove : f is one-one.
Case I. When n1 and n2 are both odd
Here, n1≠n2
⇒ n1−1≠n2−1
⇒ f(n1)≠f(n2)
Case II, When n1 and n2 are both even
Here, n1≠n2
n1+1≠n2+1
⇒ f(n1)≠f(n2)
Case III. When n1 is odd and n2 is even
Here, f(n1)=n1−1 is even
f(n2)=n2+1 is odd
⇒ f(n1)≠f(n2)
Case IV. When n1 is even and n2 is odd
Here, f(n1)=n1+1 is odd
f(n2)=n2−1 is even
⇒ f(n1)≠f(n2)
Thus, in all cases n1≠n2⇒f(n1)≠f(n2)
⇒f is one-one
To Prove : f is onto
If n∈W is any element, then
f(n−1)=n, if n is odd
and f(n+1)=n, if n is even
∴ Each element of W is f image of some element of W.
Thus f is onto
Hence, f is invertible
Now, f(n−1)=n, if n is odd
f(n+1)=n, if n is even
⇒ n−1=f−1 (n), if n is odd
n+1=f−1 (n), if n is even
Thus, f−1(n)={n−1,ifn is oddn+1,ifn is even.
Hence, f−1=f