Not Understanding a specific substitution rule I was given the question,
If $f(3x+5) = x^2-1$, what is $f(2)$? I am trying to understand the reasoning why $3x+5$ is set equal to $2$.

Let's say $u=3x+5$. Then, $x^2-1=(\frac{u-5}{3})^2-1$. $\Rightarrow$ $f(u)=(\frac{u-5}{3})^2-1$ $\Rightarrow$  $f(x)=(\frac{x-5}{3})^2-1$. Now we can easily see that $f(2)=0$ . However, instead of doing all these complicated stuff, we could have made the following deduction: $3x+5=2$ $\Rightarrow$ $x=-1$ $\Rightarrow$ $x^2-1=0$. To summarize, $3x+5=2 \Rightarrow x^2-1=0$ $\:\:\:\equiv\:\:\:$ $f(2)=0.$
SIMILAR EXAMPLE
$f(x-1)=x^2\Rightarrow f(0)=?$
Say $u=x-1 \Rightarrow (u+1)^2=x^2 \Rightarrow f(u)=(u+1)^2 \Rightarrow f(x)=(x+1)^2 \Rightarrow f(0)=1.$
OR
Set $$x-1=0 \Rightarrow x=1 \Rightarrow x^2=1$$
$$\Downarrow$$
$$x-1=0 \: and \: x^2=1 \:\:\equiv\:\: f(0)=1$$
