Let $\phi$ be a continuous, real-valued function defined in some neighborhood of $0$. Writing
$$
f(x) = \int_{0}^{x} \phi(x)\, dx
$$
is bad syntax: it uses the single letter $x$ for both
Setting $x = 2$, for example, invites the reader to ponder the meaning of
$$
f(2) = \int_{0}^{2} \phi(2)\, d2,
$$
which is almost surely not intended. (The problem is "$d2$".)
Strictly speaking, "no", it is not okay to have a function $f$ defined by
$$
f(x) = \int_{0}^{x} (x^{2} - x)\, dx.
$$
By contrast, equations such as
$$
g(x) = \int_{0}^{x} \phi(t)\, dt,\qquad
h(x) = \int_{0}^{x} (x - t)\phi(t)\, dt,
$$
do properly define functions. Note carefully that in the defintion of $h$, the input value $x$ appears in the integrand but is not the variable of integration.
The fundamental theorem of calculus gives
$$
g'(x) = \phi(x),\qquad
h'(x) = \int_{0}^{x} \phi(t)\, dt = g(x).
$$
The second is an edifying exercise; to give a proof, it may help to write
$$
h(x) = \int_{0}^{x} (x\phi(t) - t\phi(t))\, dt
= x\int_{0}^{x} \phi(t)\, dt - \int_{0}^{x} t\phi(t))\, dt
= xg(x) - \int_{0}^{x} t\phi(t)\, dt.
$$