Let $(X, d)$ be a metric space. $f:X \to [0,\infty]$ is lower semicontinuous, $f(p)<\infty$ for at least one $p\in X$. For n natural, define $$g_n(x)=\inf \{f(p)+nd(x,p) : p \in X\}.$$
I have to prove $$|g_n(x)−g_n(y)|≤nd(x,y).$$
(I have tried using $g_n(x)≤f(y)+nd(x,y)$; $g_n(y)≤f(y)$ and the triangle inequality, but I didn't get to the desired inequality.)
Thanks in advance!