Proposition: $X,Y$ Polish spaces. $A \subset X$ a Borel subset. Then: $f$ is Borel measurable if and only if its graph is a Borel subset of $X \times Y$.
my Question: I can't see where in the proof we need that graph(f) is a Borel subset instead of only beeing an analytic subset.
I think there is no problem with what you say.
Your statement is "if and only if". You prove $f$ Borel $\Longrightarrow$ graph is Borel. The converse is true: graph is Borel $\Longrightarrow f$ is Borel. This much (Prop. 8.3.4) can be proved without the theory of analytic sets.
But you noted that more is true: graph is anaytic $\Longrightarrow f$ is Borel. This is also true, but (of course) requires the theory of analytic sets. If $E$ is Borel, then both $f^{-1}(E)$ and its complement $A \setminus f^{-1}(E) = f^{-1}(Y \setminus E)$ are analytic, so $f^{-1}(E)$ is Borel.