A function composed with itself produces the identity Let $B$ be the closed unit ball in $\mathbb R^3$ and $f: B\to B$ continuous, such that $f\circ f$ is the identity (i.e., $f\circ f=\mathbb 1_B$) and $f$ restricted on $\partial B$ is also the identity (i.e., $f|_{\partial B}=\mathbb 1_{\partial B}$). Does it imply that $f$ is the identity on $B$?
EDIT. If $B$ is instead the closed unit ball in $\mathbb R^2$, then the answer is also positive. (See Action on a Disk is Controlled by the Boundary, problem 10442, by
R. Bielawski & O. P. Lossers. Am. Math. Monthly, Vol. 105, No. 9 (Nov., 1998), pp. 860-861.)
 A: Yes.  Observe first that $f$ can be first extended to an involution of $\mathbb{R}^3$ and then to an involution $F : S^3 \rightarrow S^3$ of the one-point compactification of $\mathbb{R}^3$.  A classical theorem of P. A. Smith then says that the fixed-point set of $F$ is homeomorphic to either $S^0$ or $S^1$ or $S^2$ or $S^3$; see Theorem 4 of
MR0000177 (1,30c)
Smith, P. A.
Transformations of finite period. II. 
Ann. of Math. (2) 40, (1939). 690–711. 
By the way, the proof shows that if $F$ is orientation-preserving, then the fixed-point set of $F$ must either be $S^1$ or $S^3$, while if $F$ is orientation-reversing, then the fixed-point set of $F$ must either be $S^0$ or $S^2$.  In any case, from our construction it is clear that the fixed-point set of $F$ must be $S^3$, i.e. $F = \text{id}$.
I should remark that Smith's theorem is the beginning of a long story.  See, in particular, the book
MR0758459 (86i:57002)
The Smith conjecture. 
Papers presented at the symposium held at Columbia University, New York, 1979. Edited by John W. Morgan and Hyman Bass. Pure and Applied Mathematics, 112. Academic Press, Inc., Orlando, FL, 1984. xv+243 pp. ISBN: 0-12-506980-4 
The main theorem discussed in this book says that if $F$ is a nontrivial periodic orientation-preserving homeomorphism of $S^3$, then the fixed-point set of $F$ is an unknotted circle; this implies that $F$ is topologically conjugate to an element of the orthogonal group.  This result was one of the first triumphs of Thurston's work on 3-manifolds.

EDIT : As Mathieu Baillif points out in the comments, an easier way to finish this off would be to appeal to a theorem of M. H. A. Newman which asserts that if $M$ is any connected manifold and if $F:M \rightarrow M$ is a uniformly continuous periodic homeomorphism that fixes a nonempty open set in $M$, then $F$ is the identity.  The reference for this result is
M. H. A. Newman, A theorem on periodic transformations of spaces, Q J Math (1931) (1): 1-8.
I remark that despite its age, this paper is very readable.

EDIT 2 : I intended (but forgot) to mention in the above answer that the tricky point in this question is that $f$ is only assumed to be continuous.  If $f$ is assumed to be smooth, then the question is much easier.  Indeed, we have the following easy lemma.
LEMMA : Let $M$ be a smooth manifold with nonempty boundary and let $f : M \rightarrow M$ be a smooth map such that $f^k = \text{id}$ for some $k \geq 1$ (here the exponent means composition) and $f|_{\partial M} = \text{id}$.  Then $f = \text{id}$.
To prove the lemma, we first prove that there is an open set $U \subset M$ such that $f|_U = \text{id}$.  Choose a Riemannian metric $\mu'$ on $M$.  Defining $\mu = \sum_{i=0}^{k-1} (f^i)^{\ast}(\mu')$, the Riemannian metric $\mu$ is $f$-invariant.  Fix a point $p_0 \in \partial M$.  Since $f|_{\partial M} = \text{id}$ we have $f(p_0)=p_0$.  Even better, $D_{p_0} f : T_{p_0} M \rightarrow T_{p_0} M$ is the identity on a codimension $1$ hyperplane.  Since $D_{p_0} f$ preserves the metric and orientation at $p_0$, we conclude that in fact $D_{p_0} f = \text{id}$.  Using the exponential map, we deduce that $f$ is the identity on a neighborhood of $p_0$.
In particular, there exists a point $q_0$ in the interior of $M$ such that $f(q_0)=q_0$ and $D_{q_0}f = \text{id}$.  Using an averaging trick as in the previous paragraph, we can choose a complete $f$-invariant Riemannian metric $\nu$ on $\text{Int}(M)$, which is a manifold without boundary.  Since $\nu$ is complete, any two points in $\text{Int}(M)$ are connected by a $\nu$-geodesic.  Using the exponential map at $q_0$, we thus deduce that $f|_{\text{Int}(M)} = \text{id}$, which implies that $f = \text{id}$.
