The triangular function: 
as fedja remarks in his comment,  when $p(x)$ is supported in $[0,1]$ and symmetric around 1/2, there is a solution from $\infty$ and a solution from $-\infty$.    The condition that they coincide is  that  $1-g^{-1}(1-x)$ also satisfies  (1) so  $g^{-1}(x) = 1-g(1-x)$ and therefore $$\epsilon p(x) = g(x) + g(1-x) -1   (2)$$. 
Using this equation find  $g(1/2) = (1 + \epsilon p(1/2))/2$.  This incidentally gives us $$ g^{-1}((1 + \epsilon p(1/2))/2)$$ and using equation (1) find $g(g(1/2)$.  Iterate, finding the value of g at all the points $g(1/2), g(g(1/2),...$  and iterating backwards, which you can using $g^{-1}$ in place of g and making the appropriate changes, find g at all values $g^n(1/2)$.  Then, I claim, $g$ and $g^{-1}$ are linear in between. 
 $$$$  Interpolate g linearly on $(1/2, g(1/2)$.  p(x) is linear on this interval, so this wants to force $g^{-1}$ to be linear on the same interval. However, there is already a definition of $g^{-1}$, and I need to show that they are the same.  To solve the equation $g^{-1}(x) = y$ for $x \in (1/2, g(1/2)$ we need to know for what values of $y$ is $g(y) \in (1/2, g(1/2)$, and that is the interval $(g^{-1}(1/2), 1/2)$  but we have already defined $g^{-1} $ to be linear on this interval.  As the correct relations hold at the  endpoints, and  all functions are linear in between,  this definition of $g$ works. $$$$ 
There is a lacuna I don't know how to deal with, this all seems good provided that $g^n(1/2) \rightarrow 1$ as $n \rightarrow \infty$.  This can't always be true, but I don't know when what I have sketched above fails.