(P(x, y) ∨ (∀x (∃y (Q(x) → R(x, y,z)))))
I know that for P(x,y), x and y are free because there are no quantifiers. But for (∀x (∃y (Q(x) → R(x, y,z)))), x and y are are bounded, and z is free.
In this case, which occurrences of each variable in the tree are bound and which are free?
As you say corrcetly, in the subformula $P(x,y)$ the occurrences of $x$ and $y$ are both free.
For:
we have that only $z$ has a free occurrence.
The parentheses "define" the scope of the quantifiers. The scope of $\forall x$ is the formula: $∃y \ (Q(x) → R(x, y, z))$. Thus, both occurrences of $x$ in it are bound.
The same for $\exists y$, having scope: $Q(x) → R(x, y, z)$.
We may define formally:
If you use a parsing tree to analyze your formula, you will have $\lor$ as the root and the subformula $P(x,y)$ as left leaf.
$P(x,y)$ is not in the scope of any quantifier, and thus all occurrences of variables in it a free.
On the right branch we will find the node $\forall x$, and thus all occurrences of $x$ in the sub-tree starting from it will be in its scope, and thus will be bound.
And so on.