Solution:
The condition is symmetric so we can assume that b≤a.
The first case is when a=b. In this case, a!+a=5m for some positive integer m. We can rewrite this as a⋅((a−1)!+1)=5m. This means that a=5k for some integer k≥0. It is clear that k cannot be 0. If k≥2, then (a−1)!+1=5l for some l≥1, but a−1=5k−1>5, so 5∣(a−1)!. However, 5∣(a−1)!+1, which is not possible. This means that k=1 and a=5. In this case, 5!+5=125, which gives us the solution (5,5).
Let us now assume that 1≤b<a. Let us first assume that b=1. Then a+1=5x and a!+1=5y for integers x,y≥1. If x≥2, then a=5x−1≥52−1>5, so 5∣a!. However, 5∣5y=a!+1, which leads to a contradiction. We conclude that x=1 and a=4. From here a!+b=25 and b!+a=5, so we get two more solutions: (1,4) and (4,1).
Now we focus on the case 1<b<a. Then we have a!+b=5x for x≥2, so b⋅(ba!+1)=5x, where b∣a! because a>b. Because b∣5x and b>1, we have b=5z for z≥1. If z≥2, then 5<b<a, so 5∣a!, which means that ba!+1 cannot be a power of 5. We conclude that z=1 and b=5. From here 5!+a is a power of 5, so 5∣a, but a>b=5, which gives us a≥10. However, this would mean that 25∣a!, 5∣b and 25∤b, which is not possible, because a!+b=5x and 25∣5x.
We conclude that the only solutions are (1,4), (4,1) and (5,5).