Let's say I have this functional equation
$$f(x)\cdot f(y)=f(x)+f(y)+f(xy)-2$$
For all $ x,y \in R$
And I have given with $f(2)=5$
If I proceed to find $f(1)$
By substituting $x=1$and $y=2$
Then I will be getting $f(1)=2$ by using the given relation [$f(2)=5$]
But if I substitute $x=1$and $y=1$
And on solving for $f(1)$.
I am getting two values for $f(1)$ i.e $2$ and $1$
Now what is wrong in second approach.
Your method is correct. You get $f(1)=1$ or $f(1)=2$ for candidates. But you need to plug into the original equation to verify these two candicates.
Assume $f(1)=1$
$$ f(1)\cdot f(2)=f(1)+f(2)+f(1\cdot2)-2\Longrightarrow f(2)=1 $$
But this contradicts with the given condition $f(2)=5$, hence drop this candidate.
Next, you verify the other candidate $f(1)=2$
$$ f(1)\cdot f(2)=f(1)+f(2)+f(1\cdot2)-2\Longrightarrow f(2)=5 $$
This agrees with the given condition, so the correct value is $f(1)=2$.