Answer
See the detailed answer below.
Work Step by Step
$$\color{blue}{\bf [a]}$$
Let's assume that the cross-sectional area of the wire is a flat disk of radius $R$.
We can divide this disk into many infinitesimal loops (rings). Each loop contains a current of $dI$ and its thickness is $dr$, and hence its area is $dA=2\pi r dr$
Recalling that $J=I/A$ where $J$ is the current density, so
$$dI=JdA$$
where $J$ is given by $J_0r/R$, so
$$dI=\dfrac{2\pi J_0r^2dr }{R}\tag 1$$
Integrating both sides,
$$\int_0^IdI=\int_0^R\dfrac{2\pi J_0r^2dr }{R}$$
$$ I=\dfrac{2\pi J_0 }{R}\int_0^Rr^2dr$$
$$ I=\dfrac{2\pi J_0 }{R} \dfrac{R^3}{3}$$
$$ I=\dfrac{2\pi J_0R^2 } {3}\tag 2$$
Hence,
$$\boxed{J_0=\dfrac{3I}{2\pi R^2}}$$
$$\color{blue}{\bf [b]}$$
We need the magnetic field inside the wire, so we need to use Ampere's law.
The magnetic field of a loop of radius $r$ and thickness $dr$ where $r\lt R$ is given by
$$\oint Bds=\mu_0dI_{\rm through}$$
the enclosed current at $r\lt R$ is given by (1);
$$\oint Bds=\dfrac{2\pi \mu_0J_0r^2dr }{R}$$
$$B(2\pi r)=\int_0^r\dfrac{2\pi \mu_0J_0r^2dr }{R}$$
$$B(2\pi r)=\dfrac{2\pi \mu_0J_0 }{R}\int_0^rr^2dr$$
$$B(2\pi r)=\dfrac{2\pi \mu_0J_0 r^3 }{3R} $$
Plug $J_0$ from the boxed formula above,
$$B(2\pi r)=\dfrac{2\pi \mu_0 r^3 }{3R}\cdot \dfrac{3I}{2\pi R^2} $$
Therefore,
$$\boxed{B =\dfrac{ \mu_0 Ir^2 }{2\pi R^3} }$$
$$\color{blue}{\bf [c]}$$
At $r=R$, using the previous boxed formula of part b above,
$$B=\dfrac{ \mu_0 IR^2 }{2\pi R^3}$$
$$\boxed{B=\dfrac{ \mu_0 I }{2\pi R }}$$
which matches the formula of $B_{\rm wire}=\mu_0 I/2\pi d$