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}$.