Since there is only one mode, #x# must be the mode and be either #3#, #4#, #5#, or #8#.

(If #x# were not one of #3#, #4#, #5#, or #8#, then there will be no mode. Since it must be one of #3#, #4#, #5#, or #8#, #x# will be the mode.)

But #x# cannot be #3# or #8#. If it were either #3# or #8#, it would not be the median. But the median has the same value as the mode.

Thus, #x# can only be #4# or #5#. Now, if you find the mean of the set when #x# is #4#, you get #(3+4+5+8+4)/5=24/5#. If you find the mean of the set when #x# is 5, you get #(3+4+5+8+5)/5=5#.