sed 's/\(.\)\( \1\)\{1,\}/\1+/g' <in >out
x y+ z x
x+ y z+ y
x+ z y
y z+ y x+
x+
With BSD or GNU sed:
sed -Ee's/(.)( \1)+/\1+/g' <in >out
To work with arbitrary field lengths, you just do it with arbitrary field lengths:
sed -Ee 's/(...)( \1)+/\1+/g' <<""
xxx yyy yyy zzz xxx
xxx xxx yyy zzz zzz yyy
xxx xxx xxx zzz yyy
yyy zzz zzz yyy xxx xxx xxx
xxx xxx xxx xxx xxx
xxx yyy+ zzz xxx
xxx+ yyy zzz+ yyy
xxx+ zzz yyy
yyy zzz+ yyy xxx+
xxx+
Or w/ @terdon's input slightly modified in the second line:
sed -Ee's/(([^ ]+ *)+)( +\1)+/<\1>+/g' <<""
foo foo foo bar foo
bar foo bar foo
foo foo x x x bar
<foo>+ bar foo
<bar foo>+
<foo>+ <x>+ bar