I had basically the same approach as the one in jules' answer. So this won't add much new, but I will post it anyway, and maybe it motivates the counterexample a bit more.
Let $G := \{x \in R: x^2 = 1\}$. If $R$ is commutative, this is an abelian group under multiplication such that $x^2=1$ for every $x \in G$. Such groups are called elementary $2$-abelian and are the same as vector spaces over $\mathbb{F}_2$. If $d$ is the dimension, we get an isomorphism $G \cong \mathbb{F}_2^d$ and the claim follows.
More generally, if $R$ is not necessarily commutative, but $G$ is multiplicatively closed, i.e. $x^2=y^2=1 \implies (xy)^2=1$, then $G$ is a subgroup, and it is abelian, so the same proof works.
So to look for a counterexample, we need to have (at least) a ring with elements $x,y$ with $x^2=1$, $y^2=1$, but $(xy)^2 \neq 1$. The universal example of a ring with two elements whose squares are $1$ is the ring
$$R := \mathbb{Z}\langle X,Y \rangle / (X^2-1, Y^2-1),$$
which is isomorphic to the group ring $\mathbb{Z}[G]$ where $G = C_2 * C_2 \cong D_{\infty}$ (infinite dihedral group). The elements of $G$ are $1$, $X$, $Y$, $XY$, $YX$, $XYX$, $YXY$, etc. and these form the $\mathbb{Z}$-basis of $R$. But I had a really hard time to calculate the solutions of $r^2=1$ here, even though it is quite likely that $\pm 1, \pm X, \pm Y$ are the only (six) solutions, unless I am missing something. (Can someone check this?)
The ring becomes considerably easier to handle if we introduce another relation, such as $YX=-XY$, so that $X,Y$ anti-commute. The quotient ring
$$R := \mathbb{Z} \langle X,Y \rangle / (X^2-1,Y^2-1,XY+XY)$$
has only $4$ generators as a $\mathbb{Z}$-module: $1$, $X$, $Y$, $XY$. In this ring, we can compute
$$(a+bX+cY+dXY)^2 = (a^2 + b^2 + c^2 - d^2) + 2ab X + 2ac Y + (2ad) XY.$$
This is $1$ iff we have $ab=ac=ad=0$ and $a^2+b^2+c^2-d^2=1$. If $a=0$, this means $b^2+c^2-d^2=1$. If $a \neq 0$, we get $b=c=d=0$ and $a^2=1$, i.e. $a = \pm 1$.
Now, unfortunately, $b^2+c^2-d^2=1$ has infinitely many solutions in $\mathbb{Z}$. But we can easily replace $\mathbb{Z}$ by any other commutative ring $k$. As soon as $k$ is an integral domain with $2 \in k^{\times}$, the same arguments work with the $k$-algebra
$$R := k\langle X,Y \rangle / (X^2-1,Y^2-1,XY+YX).$$
The equation $r^2=1$ has the two trivial solutions $\pm 1$ as well as the solutions $bX + cY + dXY$, where $b^2+c^2-d^2=1$. The latter equation is equivalent to $b^2 = 1 + d^2 - c^2$. Counting the solutions is now doable for every finite field in particular, for the case $k = \mathbb{F}_3$ see jules' answer. We just need to take $c,d \in k$ and check if $1 + d^2 - c^2$ is a square. Then there are $2$ solutions for $b$ (resp. $1$ if the square is zero).