_ƝṠÞ+SƊƑ
Try it online!
How it works
_ƝṠÞ+SƊƑ Main link. Argument: n (integer)
_Ɲ Take the differences of neighboring digits.
This maps n = abcd to [a-b, b-c, c-d].
Ƒ Fixed; apply the link to the left and return 1 if the result is equal to
its argument, 0 if not.
Ɗ Drei; combine the three links to the left into a monadic chain.
ṠÞ Sort the differences by their signs (negative, zero, positive).
S Take the sum of the differences, yielding 0 if and only if the
first digit is equal to the last.
+ Add the sum to each difference.