Determining the primitive root $g$ of $p$, given $B=g^b \pmod p$ This is related to Diffie-Hellman key exchange.

Suppose you're given a prime $p, b \in \{0,1,...,p-2\}$, and $B$, such that
$$ 
B= g^b \pmod p. 
$$

Assuming that $$\gcd(b, p-1)=1$$ How could you determine the primitive root $g$?
If $\gcd(b,p-1)=1$ you have  $u\cdot b + y\cdot (p-1) = 1$ where $u=b^{-1} \bmod {(p-1)}$. With Euler's theorem $B^{p-1} \equiv 1\bmod p$ you get
$$g \equiv B^u \bmod p.$$

Right you are with your comment, I have included the changes. Euler's theorem is used at the penultimate step: 
This is the 'easy case' on page 4 of the reference given by SEJPM
$$g^u \equiv (B^u)^b \equiv B^{ub} \equiv B^{1-y(p-1)} 
\equiv B \cdot (B^{p-1})^{-y}\equiv B \cdot 1^{-y}\equiv B \bmod p$$
Example: $p=11, b=7, B=4$.  Compute:
$$u \equiv 7^{-1} \equiv  3 \bmod {10}$$
$$g \equiv 4^3  \equiv 9 \bmod {11}$$
and check:
$$9^7 \equiv 4 \bmod 11$$