Is the class of Turing-recognizable languages closed under Homomorphism?
Your proof has a flaw.

Assume $L=\{b\}$, and $f(a)=f(b)=w$ for some word $w$. We have $f(L)=\{w\}$.

TM $M'$ on $w$ finds the preimage $a$, then checks $a\not\in L$, and rejects. This is wrong, since $w$ should be accepted.

The point is, we should not reject $w$ just because we found a preimage of $w$ which is not in $L$. We should continue checking all such preimages. 

Above, doing that we would consider $b$ as well, and cause $w$ to be accepted.