λ=N[Sqrt[5]-1]/2;
ϕ[_][x_] := x;
ϕ[ns___,n_, ff_ (* "flat fraction" *)][x_] := Module[
{
s=Times[ns,n],
x0, y0, x1, y1, mu, nu
},
y0=ϕ[ns,ff][x0 = Floor[s*x]/s];
y1=ϕ[ns,ff][x1 = x0+1/s];
mu=1/s;
If[(1-ff)/2<(x-x0)*s<(1+ff)/2, Return[(y0+y1)/2+mu*(x-(x0+x1)/2)]];
nu = ((y1-y0)/(x1-x0)-mu*ff)/(1-ff);
If[(x-x0)*s<1/2, Return[y0+nu*(x-x0)]];
y1+nu*(x-x1)
]

Plot[{ϕ[0.5][x], ϕ[2,0.5][x], ϕ[2,4,0.5][x]}, {x,0,1}, PlotPoints -> 33, MaxRecursion -> 0, Exclusions -> None]

Rasterize[
Plot3D[ϕ[2,4,0.5][x]+λ*ϕ[2,4,0.5][y], {x,0,1}, {y,0,1},
PlotPoints -> 33, Mesh -> 33, MaxRecursion -> 0, Exclusions -> None
]]