I want to find function(s) $g$ satisfying $$\int_0^{x^2} \operatorname{tg}(t)dt=x+x^2 \tag{1}$$
*Assuming that $ \operatorname{tg}(t)$ is continuous on $[0,x^2]$, fundamental theorem of calculus gives: $2x^3g(x^2)=1+2x \\\Rightarrow g(x^2)= 0.5 x^{-3}+x^{-2} \;\text{for all $x\ne0$}\;\\\Rightarrow g(t)=0.5t^{-3/2}+t^{-1} \;\;\forall t\gt 0$ $\tag{2}$
Defining $g$ as follows: $$g=\begin{cases} 0.5t^{-3/2}+t^{-1} & t\gt 0 \\[12pt] 1 & t\le0 \end{cases} \\\Rightarrow \operatorname{tg}(t)=\begin{cases} 0.5t^{-1/2}+t & t\gt 0 \\[12pt] t & t\le0 \end{cases}$$
For all $x,\operatorname{tg}(t) $ satisfies $(1)$. I am unable to understand the following:
Question 1: Why this $g(t)$ is an acceptable solution because clearly $ \operatorname{tg}(t)$ is not continuous at $0$ hence violating our assumption *, in which case we can not apply Fundamental Theorem of Calculus because the integrand is not continuous on $[0,x]$.
Question 2: How can it be shown/proven that $g(t)$ above is the only solution.
Can anyone please help me on this? Any help on this will be highly appreciated. Thanks in advance.