Function Composition and Expected Value I was presented with the question

The function $f(x)$ is equal to $x^2$ and the function $\chi(x)$ gives a random real number from 0 to $x$. Which usually has a greater expected value, $(f \circ \chi)(x)$ or $(\chi \circ f)(x)$ For what values of $x$?

I am almost entirely unexperienced in the field of probability. My approach to this was first to find the expected value of $\chi(x)$, which I think should be
$$\frac{1}{x}\int_0^x x dx=\frac{1}{2}x$$
meaning that the expected value of $(f \circ \chi)(x)$ should be 
$$f(\frac{1}{2}x)=\frac{1}{4}x^2$$
Then I figured that the expected value of $(\chi \circ f)(x)$ would be
$$\frac{1}{x^2}\int_0^{x^2} x dx=\frac{1}{2}x^2$$
Are my methods correct here? If not, how would I go about doing this?
 A: If we take a given number $x_0$, then our random number is a uniform random variable $X$ on $[0,x_0]$. Its probability density function is:
$$ f_{X}(x) = \begin{cases} \frac{1}{x_0} & 0\leq x \leq x_0 \\ 0 & \text{else} \end{cases} $$
If we generate a random number from this distribution, and then square it, our expected value is the expectation of $X^2$:
\begin{align*}
\mathbb{E}[X^2] &= \int_{-\infty}^\infty x^2f_{X}(x) \, dx \\
&=\int_0^{x_0} \frac{x^2}{x_0} \, dx \\
&= \frac{1}{x_0} \int_0^{x_0} x^2 \, dx \\
&= \frac{1}{x_0} \cdot \frac{x_0^3}{3} \\
&= \frac{x_0^2}{3}
\end{align*}

If we take a given number $x_0$, and square it to get $x_0^2$, our random number is a uniform random variable $Y$ on $[0,x_0^2]$. Its probability density function is:
$$ f_Y(x) = \begin{cases} \frac{1}{x_0^2} & 0\leq x \leq x_0^2 \\ 0 & \text{else} \end{cases} $$
If we generate a random number from this distribution, our expected value is the expectation of $Y$:
\begin{align}
\mathbb{E}[Y] &= \int_{-\infty}^\infty x f_Y(x) \, dx \\
&= \int_0^{x_0^2} \frac{x}{x_0^2} \, dx \\
&= \frac{1}{x_0^2} \int_0^{x_0^2} x \, dx \\
&= \frac{1}{x_0^2} \cdot \frac{x_0^4}{2} \\
&= \frac{x_0^2}{2}
\end{align}

Hence, we have shown that if we take our $x_0$, generate a random number, and then square it, our expectation is:
$$ \mathbb{E}[(f \circ \chi)(x_0)] = \frac{x_0^2}{3} $$
while on the other hand, if we take our $x_0$, square it, then generate a random number, our expectation is:
$$ \mathbb{E}[(\chi \circ f)(x_0)] = \frac{x_0^2}{2} $$
