I think this function is injective, but had a tough time proving it. Here's my attempt.
Proof: Let $(x_1,x_2)$ be arbitrary elements of $\mathbb{P}_1$. Assume $g(x_1)=g(x_2)$, i.e. $\int_0^x x_1dt=\int_0^x x_2dt$. Integrating yields $\frac{1}{2}(x_1)^2=\frac{1}{2}(x_2)^2\implies \frac{1}{2}x^2=\frac{1}{2}x^2$. This implies that $x_1=x_2$, so the function $g$ is injective.