Answer
See the detailed answer below.
Work Step by Step
$$\color{blue}{\bf [a]}$$
From the given formula, it is obvious that the magnetic field is zero at $x=0$, and is $B_0$ at $x=l$. And it is zero everywhere.
See the graph below.
$$\color{blue}{\bf [b]}$$
We know that the magnetic force exerted on a current-carrying wire is given by
$$F=BIl \sin\theta$$
Note that $\theta=90^\circ$ because $B$ is in the $z$-direction.
$$F=BIl\sin90^\circ=BIl $$
Thus, the force $dF$ exerted on a small segment of the wire $dx$ is given by
$$dF=BIdx\tag 1$$
Integrating both sides,
$$\int_0^FdF=\int_0^lBIdx$$
Thus,
$$F=\int_0^l\dfrac{B_0xI}{l}dx=\dfrac{B_0 I}{l}\int_0^l xdx$$
$$F =\dfrac{B_0 I}{2l} x^2dx\bigg|_0^l$$
$$F =\dfrac{B_0 I}{2l} l^2-0 $$
$$\boxed{F =\frac{1}{2 } B_0 Il }$$
According to the right-hand rule, the direction of this force is in the positive $y$-direction
$$\color{blue}{\bf [c]}$$
The torque $d\tau$ exerted on a small segment of the wire $dx$ is given by
$$d\tau=r dF\sin90^\circ=rdF$$
Plug from (1), and replace $x$ by $r$
$$d\tau= x BIdx$$
Integrating both sides,
$$\int_0^\tau d\tau= \int_0^l x BIdx$$
$$ \tau= \int_0^l \dfrac{B_0x}{l}x Idx=\dfrac{B_0I}{l} \int_0^l x^2 dx$$
$$ \tau= \int_0^l \dfrac{B_0x}{l}x Idx=\dfrac{B_0I}{3l} \bigg|_0^l x^3$$
$$ \tau= \dfrac{B_0Il^3}{3l} $$
$$ \boxed{\tau= \frac{1}{3}B_0Il^2 }$$