The key to understanding when a ring of the form $k[p(t),q(t)]$ for two nonconstant polynomials $p(t),q(t)$ is a UFD is that such a ring is the coordinate algebra of a 1-dimensional affine curve in $\Bbb A^2_k$. This means that $k[p(t),q(t)]\cong k[x,y]/(f(x,y))$ for some polynomial $f(x,y)$. Such a ring is a UFD if and only if it's normal and has vanishing class group. In particular, if $V(f)$ isn't normal, it can't be a UFD.
To explain why $k[p(t),q(t)]\cong k[x,y]/(f)$, we can eliminate $t$ from the system $\{x-p(t),y-q(t)\}$ to get a single relation between $x$ and $y$: this will be our $f$. In our case, we can use the resultant to do this and get $$k[t^2+t,t^3+t]\cong k[x,y]/(x^3+2x^2-3xy+2x-y^2-2y).$$ From here, we look to verify that $V(f)$ is smooth, as any normal curve is smooth.
To check smoothness, we compute the partial derivatives: $$\frac{df}{dx} = 3x^2+4x-3y+2$$ $$\frac{df}{dy} = -3x-2y-2$$
and doing some light algebra, we see that after setting each of these equal to zero, we have two solutions: $(-2,2)$ and $(\frac{-5}{6},\frac14)$. Plugging in to our original equation, we see that $(-2,2)$ is on our curve (it's given by $t=\frac{-1\pm \sqrt{-7}}2$), so we see that our curve is singular. As normal curves are smooth, we see that our curve isn't normal, so $k[t^2+t,t^3+t]$ cannot be a UFD.
If we had instead found that our ring was integrally closed in it's field of fractions, we'd have more work to do: we'd have to compute the class group and check if that vanished or not.