Given. $f(x) = 2x/R^2$ on $0 < x < R$ (and $0$ elsewhere), with $R>0$ a fixed constant.
Find. (a) verify $f$ is a valid pdf; (b) $E[X]$; (c) $\mathrm{Var}(X)$.
Approach. A valid pdf must be non-negative everywhere and integrate to 1 over its support; the mean and variance follow from $E[X]=\int x f(x)\,dx$ and $\mathrm{Var}(X)=E[X^2]-(E[X])^2$.
Part (a) — non-negativity and normalization. On $0 < x < R$, both $x>0$ and $R^2>0$, so $f(x)=2x/R^2 \ge 0$ everywhere on the support (and $f(x)=0$ elsewhere), satisfying the first pdf requirement. For the second requirement,
$$\int_{-\infty}^{\infty} f(x)\,dx = \int_0^R \frac{2x}{R^2}\,dx = \frac{2}{R^2}\left[\frac{x^2}{2}\right]_0^R = \frac{2}{R^2}\cdot\frac{R^2}{2} = \boxed{1}.$$
Both conditions hold, so $f(x)$ is a valid probability density function.
Part (b) — mean. By definition,
$$E[X] = \int_0^R x\cdot\frac{2x}{R^2}\,dx = \frac{2}{R^2}\int_0^R x^2\,dx = \frac{2}{R^2}\left[\frac{x^3}{3}\right]_0^R = \frac{2}{R^2}\cdot\frac{R^3}{3} = \boxed{\dfrac{2R}{3}}.$$
Part (c) — variance. First find the second moment,
$$E[X^2] = \int_0^R x^2\cdot\frac{2x}{R^2}\,dx = \frac{2}{R^2}\left[\frac{x^4}{4}\right]_0^R = \frac{2}{R^2}\cdot\frac{R^4}{4} = \frac{R^2}{2}.$$
Then, substituting into $\mathrm{Var}(X)=E[X^2]-(E[X])^2$,
$$\mathrm{Var}(X) = \frac{R^2}{2} - \left(\frac{2R}{3}\right)^2 = \frac{R^2}{2}-\frac{4R^2}{9} = \frac{9R^2-8R^2}{18} = \boxed{\dfrac{R^2}{18}}.$$