The highest prime factor of neighboring numbers
Mathematica, 82 74 bytes

Thanks to Martin Ender for saving 8 bytes!

Max@@(±n_:=#//.x_/;l[t=x+n]&gt;l@x:&gt;t;l=FactorInteger[#][[-1,1]]&amp;)/@{±-1,±1}&amp;


Unnamed function taking an integer input and returning an integer.

±n_:=#//.x_/;l[t=x+n]&gt;l@x:&gt;t defines a unary function ± which keeps increasing the global function's integer input by n as long as the largest prime factor is increasing. (The largest-prime-factor function is defined with l=FactorInteger[#][[-1,1]]&amp;.) {±-1,±1} therefore applies that function twice to the input integer, with increment -1 and again with increment 1. Then, Max@@(...l...)/@... takes the larger of the two largest-prime-factors thus found.

Previous submission:

Max@@(l=FactorInteger[#][[-1,1]]&amp;)/@(#//.x_/;l[t=x+#2]&gt;l[x]:&gt;t&amp;@@@{{#,-1},{#,1}})&amp;