I have two ways to write down a certain formula, but I am not sure if both have correct syntax.
Given $f:A\rightarrow B$ and $b\in B$.
One could write
$(\forall a\in A)( f(a)=b )$,
but is it also allowed to write the following?
$(\forall a)( a\in A \implies f(a)=b )$
Both ways are fine, mathematically speaking. There might be a notational preference for one or the other depending on the situation.
The fundamental definition of the $\forall$ symbol is that $\forall x \,\psi$ means that for every $x$ in the universe of discourse, the predicate $\psi$ is true. In that sense, the notation $(\forall a)( a\in A \implies f(a)=b )$ is actually more formally correct. I'd expect to see it written this way in the context of formal logic, where the author wants to strictly follow the precise syntax rules of first-order logic.
It does have the effective meaning of "for all $a$ in $A$, we have $f(a)=b$". The predicate $a\in A \implies f(a)=b$ is vacuously true when $a \notin A$, so its truth really only depends on what happens when $a \in A$.
Since $(\forall a)( a\in A \implies \phi )$ is a little awkward to write and not as intuitively clear, the notation $(\forall a \in A) \phi$ is generally accepted as an abbreviation of it. So if anything, it's the $\forall a \in A$ notation that is the "abuse", but it's extremely common and isn't going to bother anybody except an unusually pedantic logician. This would be more likely to appear in a "working mathematics" paper, where the author is more concerned with overall mathematical meaning than with strictly precise syntax.
(In all cases, the placement of parentheses isn't really important and you can choose whatever you think looks best typographically, so long as there is no real ambiguity what you mean.)