Are you certain you copied this correctly? x+y= 5, x^{2}+ y^{2}= 31 would be very easy, x+ y= 5, x^{x}+ y^{y}= 31 is very hard!

The obvious thing to do is write the first equation as y= 5- x and substitute into the second equation: x^{x}+ (5-x)^{5-x}= 31. You might be able to put this into a form you could apply the "Lambert W function" to, but that's certainly not elementary. Other than that, I would suggest a numerical solution.

Arildno got in before me- his suggestion: look for positive integer solutions reduces the possible solutions so it can be done by direct computation.
Assuming, of course, that there are positive integer solutions!

I aint' proud. Am I helping out too much? Really, I didnt' even know to check for integers until I gave up and scrolled down to Arildno's post. Anyway, the plot is for:

Just to add something in regard to saltydog's post (I hope he'll agree with me on this):
abi ubong:
The roots of saltydog's FUNCTION Y(x) will give you the NUMBERS x in the NUMBER PAIRS (x,y) which are solutions to your system.
The corresponding NUMBERS y is found by the equation y=5-x, where x is a root for Y(x).

abia ubong: The "Lambert W function" is the inverse of the function f(x)= xe^{x}. It can be used to solve many equations in which x is both an exponent and a base.

However, if you are not in college, you probably would not be expected to know that function. Look at "salty dog"'s and "arildno"'s responses!

Look again at arildno's first suggestion. If x and y have to be positive integers AND their sum is 5, the only possibilities are:
x= 1, y= 4
x= 2, y= 3
x= 3, y= 2
x= 4, y= 1

hey firstly do not get offended arildno,also hallsofivy wat if x or y or maybe both were 2 be negative,such methods might not work i need a general solution .
thnxs