Let $G$ be a Lie group with a bi-invariant metric. Then, the Riemannian connection is given by $\nabla_XY=\frac1 2 [X,Y]$ for all $X,Y\in \mathfrak g$.
In the proof: Since $\langle X,Y\rangle$ is constant in $G$ then $Z\langle X,Y\rangle=0$ for all $Z\in \mathfrak g$ thus the Koszul's formula becomes $$2\langle \nabla_XY,Z\rangle=\langle Z,[X,Y]\rangle$$
My questions are: First, If $f:G\rightarrow R$ is a constant map and $X\in \mathfrak g$ then $X(f)=0$?
Second, Why does the last equation in the proof imply that $\nabla_XY=\frac1 2 [X,Y]$? Is it always true that if $\langle,\rangle $ is an inner product and $\langle X,Y\rangle=\langle Z,Y\rangle $ for all $Y$ then $X=Z$?
Your questions are in fact quite general:
If $M$ is any smooth manifold, $X$ a vector field on $M$ and $f:M\to\Bbb R$ a constant function, then $Xf=0$. If you think in coordinates this is obvious: $$Xf=\sum_iX^i\frac{\partial f}{\partial x^i}=0.$$
This is part of the definition of an inner-product. It must be non-degenerate meaning that $$\langle u,u\rangle=0\implies u=0.$$ In particular, if $\langle X,Y\rangle=\langle Z,Y\rangle$ for all $Y$, then $$\langle X-Z,Y\rangle=0,$$ for all $Y$. Taking $Y=X-Z$ shows that $X-Z=0$.