Suppose $f$ and $g$ are differentiable functions such that \[xg(f(x))f^\prime(g(x))g^\prime(x)=f(g(x))g^\prime(f(x))f^\prime(x)\] for all real $x$.  Moreover, $f$ is nonnegative and $g$ is positive.  Furthermore, \[\int_0^a f(g(x))dx=1-\dfrac{e^{-2a}}{2}\] for all reals $a$.  Given that $g(f(0))=1$, compute the value of $g(f(4))$.
1. **Substitute and simplify the given equation:**
   Given the equation:
   \[
   xg(f(x))f^\prime(g(x))g^\prime(x) = f(g(x))g^\prime(f(x))f^\prime(x)
   \]
   Let's introduce the substitutions \( a(x) = f(g(x)) \) and \( b(x) = g(f(x)) \). Using the chain rule, we can rewrite the derivatives:
   \[
   f^\prime(g(x)) = \frac{d}{dx} f(g(x)) \cdot \frac{1}{g^\prime(x)} = a^\prime(x) \cdot \frac{1}{g^\prime(x)}
   \]
   and
   \[
   g^\prime(f(x)) = \frac{d}{dx} g(f(x)) \cdot \frac{1}{f^\prime(x)} = b^\prime(x) \cdot \frac{1}{f^\prime(x)}
   \]
   Substituting these into the original equation, we get:
   \[
   x a^\prime(x) = b^\prime(x)
   \]
   Dividing both sides by \( a(x) \) and \( b(x) \), we obtain:
   \[
   x \frac{a^\prime(x)}{a(x)} = \frac{b^\prime(x)}{b(x)}
   \]
   This implies:
   \[
   x (\ln a(x))^\prime = (\ln b(x))^\prime
   \]

2. **Integrate both sides:**
   Integrating both sides with respect to \( x \), we get:
   \[
   \int x (\ln a(x))^\prime \, dx = \int (\ln b(x))^\prime \, dx
   \]
   The left-hand side integrates to:
   \[
   x \ln a(x) - \int \ln a(x) \, dx
   \]
   The right-hand side integrates to:
   \[
   \ln b(x)
   \]
   Therefore, we have:
   \[
   x \ln a(x) - \int \ln a(x) \, dx = \ln b(x) + C
   \]

3. **Use the given integral to find \( a(x) \):**
   Given:
   \[
   \int_0^a f(g(x)) \, dx = 1 - \frac{e^{-2a}}{2}
   \]
   Differentiating both sides with respect to \( a \), we get:
   \[
   f(g(a)) = e^{-2a}
   \]
   Therefore, \( a(x) = f(g(x)) = e^{-2x} \).

4. **Find \( b(x) \):**
   Since \( a(x) = e^{-2x} \), we have:
   \[
   \ln a(x) = -2x
   \]
   Substituting this into our earlier equation:
   \[
   x (-2x) - \int -2x \, dx = \ln b(x) + C
   \]
   Simplifying, we get:
   \[
   -2x^2 + x^2 = \ln b(x) + C
   \]
   \[
   -x^2 = \ln b(x) + C
   \]
   Therefore:
   \[
   \ln b(x) = -x^2 + C
   \]
   Exponentiating both sides, we get:
   \[
   b(x) = e^{-x^2 + C}
   \]
   Since \( b(x) = g(f(x)) \), we have:
   \[
   g(f(x)) = e^{-x^2 + C}
   \]

5. **Determine the constant \( C \):**
   Given \( g(f(0)) = 1 \), we substitute \( x = 0 \):
   \[
   g(f(0)) = e^{0 + C} = 1
   \]
   Therefore, \( C = 0 \), and we have:
   \[
   g(f(x)) = e^{-x^2}
   \]

6. **Compute \( g(f(4)) \):**
   Substituting \( x = 4 \):
   \[
   g(f(4)) = e^{-4^2} = e^{-16}
   \]

The final answer is \(\boxed{e^{-16}}\).