Difference between $f(f(x)) = f(x)$ and $f(x) = x$? So I don't seem to have understood the concept of a function.  There are three similar problems and it was on the third problem that I noticed I did not reason correctly, but I don't know why:
a) Suppose $H$ is a function and $y$ is a number such that $H(H(y)) = y$.
What is $H(H(...(H(H(y))...))$ (function beeing invoked 80 times) ?
b) Same question if $80$ invokations is replaced by $81$
c) Same question if $H(H(y)) = H(y)$
My (brief) solutions:
a) Since invoking H two times like $H(H(y)) = y$, invoking H an even number of times will equal $y$. (correct answer, although not sure about my reasoning)
b) By the same argument as in part a), invoking H an odd number of times will always result in $H(y)$. (correct answer, although not sure about my reasoning)
c) Since $H(y)$ is a number, $H(H(y)) = H(y) \iff H(n) = n$
So by induction the answer will always be equal to $y\quad $ (This is wrong, the answer is $H(y)$.
What am I doing wrong in part c)?
 A: $H(H(y))=H(y)$ says that $H(n)=n$, but only for those $n$ which are of the form $H(y)$, which might not be all numbers.
Perhaps the simplest possible example: $H(y) = 0$ for all $y$.  Then $H(H(y)) = H(y)$ for all $y$, but $H(n)=n$ is only true for $n=0$.
A: For $(c)$, note that one application of $H$ to $y$ gives $H(y)$ (obviously). Two applications also yield $H(y)$, thanks to $H[H(y)]=H(y)$. Three applications yield
$$
H\{H[H(y)]\}=H\{H(y)\}=H(y).
$$
Can you continue?
A: A concrete exemple of why you're wrong in c):
Take the function $f : \mathbb{R} \to \mathbb{R} $ defined by $f(x) = |x|$. Then 
$$f(f(x)) = |\ |x|\ | = |x| = f(x)$$
But clearly $f(x) \neq x$ (take $x$ negative)
A: The correct reasoning for item c is: 
Suppose that  $H(H(y)) = H(y)$.  Then $H(H(H(y)))= H(H(y)) = H(y)$. So note that $H$ applied to $y$ any number of times  will always result $H(y)$.  You can prove this last assertion using induction on the number of times $H$ is applied (not induction on the argument of $H$). 
A: To answer the question in the title, consider $f: \mathbb R \rightarrow \mathbb R$ defined as $f(x)=1$. 
$f(f(x))=f(1)=1=f(x)$, but clearly $f(x)\neq x$. 
