You are on the right path. Let's try to prove that $a^{(p+3)/4}\equiv a \pmod{p}$. This is not always true, so our proof will run into a stumbling block. However, the stumbling block will tell us what the fix might be. (Conveniently, we are told what it is!)
To prove $a^{(p+3)/4}\equiv a \pmod{p}$ is equivalent to proving that $a^{(p-1)/4}\equiv 1 \pmod{p}$. Since $a$ is a quadratic residue, say $a\equiv b^2\pmod{p}$, we have $a^{(p-1)/4}\equiv b^{(p-1)/2}\equiv \pm 1\pmod p$. If you prefer, you may express this in terms of order. The order of $a^{(p-1)/4}$ is either $1$ or $2$.
If $a^{(p-1)/4}$ has order $1$, we are finished. What about if the order is $2$? Then $a^{(p+3)/4}\equiv -a \pmod{p}$. Awfully close, except for that unfortunate minus sign. That's where the $r$ of the statement of the problem comes to the rescue.