Solve equation
$$(2x+7)^2=(2x-1)^2$$
$t=2x-1 $, so equation becomes $$ (t+8)^2 = t^2 $$
Now let's make a "prohibited" - take a square root from both parts (minding that $\sqrt{x^2} = \lvert x\rvert$), so we get a union of solutions of two equations
$$ t+8 = t \\ t+8 = - t $$
$-(t+8) = t, -(t+8) = -t $ are same as the 2 equations above, so no need to solve them separately.
The first equation is a contradiction ( 0 = 8) so it has no solutions.
The second equation give $t = -4 \Rightarrow 2x-1 = -4 \Rightarrow x = -3/2$ and this is the only solution of the original quadratic equation, and it need not to be checked (substituted into original equation) because all transformations all along the way were equivalent.
May I go ahead and take square roots in that manner at my exams, is it OK?
For any real number $a$ and $b$, $a^2=b^2$ if and only if $|a|=|b|$. So, a real number $x_0$ is a solution to the equation $$ (2x+7)^2=(2x-1)^2,\tag{1} $$ if and only if $x_0$ is a solution to the equation $$ |2x+7|=|2x-1|.\tag{2} $$
Equation (1) and Equat. (2) are equivalent. So what you did is OK.
One does not necessarily introduce the variable $t$ though: Equat. (2) implies that $$ 2x+7=2x-1\quad \textbf{or}\quad 2x+7=-(2x-1). $$ Since $2x+7=2x-1$ is impossible, one has $2x+7=-(2x-1)$ and thus $$ x=\frac{-7+1}{2}=-\frac32. $$