Non injective continuous maps Motivated by comments on this question  we ask the following question:
Let $f:M\to M$  be  a  continuous map where $M$ is  a  compact  manifold and $f$ is not injective. Are there necessarily infinite number of pairs $(a,b)$ such that $f(a)=f(b)$?
What about if we replace "compact  manifold" with closed unit ball in $\mathbb{R}^{n}$ or  a compact manifold with boundary?
 A: Yes, if $f$ is not injective, there are always infinitely many such pairs - if the dimension of $M$ is $> 0$, for $\dim M = 0$ there are only finitely many such pairs since a compact manifold of dimension $0$ is finite. Let $a,b \in M$ with $f(a) = f(b)$.
If $f$ is not injective on any neighbourhood of $a$, then we find infinitely many pairs accumulating at $a$: Let $(V_n)_{n\in \mathbb{N}}$ be a neighbourhood basis of $a$ with $V_n \supset V_{n+1}$ for all $n$. By assumption, $f$ is not injective on $V_0$, so we find $a_0 \neq a,b_0 \in V_0$ with $f(a_0) = f(b_0)$. Let $n_1$ be minimal such that $a_0 \notin V_{n_1}$. Since $f$ is not injective on $V_{n_1}$, we find $a_1 \neq a, b_1 \in V_{n_1}$ with $f(a_1) = f(b_1)$. It is clear how the construction continues and yields (countably) infinitely many pairs $a_k,b_k$ with $f(a_k) = f(b_k)$. Same for $b$.
If there are disjoint open neighbourhoods $V$ of $a$ and $W$ of $b$ such that $f$ is injective on both these neighbourhoods, by the invariance of domain $f(V)$ and $f(W)$ are open neighbourhoods of $f(a) = f(b)$, so every point of $f(V) \cap f(W)$ is the image of (at least) two distinct points, so we have even $2^{\aleph_0}$ many pairs $x\neq y$ with $f(x) = f(y)$.
If $M$ is a manifold with boundary of dimension $> 1$, it is possible that there are only finitely many such pairs, consider a disk that is bent into an annulus such that there is exactly one pair of points on the boundary where the image of the boundary curve intersects.
