Zagier, in his paper 'Some Surprising Consequences of the Cohomology of SL$_2(\bf{ Z})$' (link, p. 6), studies the action of $\Gamma=PSL_2(\bf Z)$ on a vector space $V$, denoting the action by $v\ |\ \gamma$. Recall the following presentation of $\Gamma=\langle S,U\ | \ S^2,U^3=1\rangle$, where: $$S=\begin{pmatrix}0 & -1\\ 1 & 0\end{pmatrix}, U=\begin{pmatrix}1 & -1\\ 1 & 0\end{pmatrix}, T=\begin{pmatrix}1&1\\0&1\end{pmatrix}, $$ satisfying $S=UT$ and $\begin{pmatrix}1&0\\1&1\end{pmatrix}=U^2S$. Also, call $f$ a cocyle if $f(\gamma_1\gamma_2)=f(\gamma_1)|\gamma_2+f(\gamma_2).$

Now, Zagier makes the following claim:

The function $f:\Gamma\to V$ such that $f(T)=0$ and $f(S)=Q$ can be extended to a cocycle if and only if $Q$ satisfies the conditions $Q|{(1+S)=0}$ and $Q|{(1+U+U^2)}=0$.

The $\Rightarrow$ direction is clear, but the $\Leftarrow$ direction does not seem obvious by direct computation, since in that case one does not know much about $f$. Is there some general fact needed to see this?