Simplifying a reverse Fold for a Query
A more direct solution with Fold
using Range
to reverse.
With
rfc[f_, g_, i_Integer?Positive] :=
Fold[g[f[#2] /* #1] &, g[f[i]], Range[i - 1, 1, -1]]
Then
rfc[f, g, #] & /@ Range[4] // Column
g[f[1]] g[f[1]/*g[f[2]]] g[f[1]/*g[f[2]/*g[f[3]]]] g[f[1]/*g[f[2]/*g[f[3]/*g[f[4]]]]]
Hope this helps.
fn[f_, g_, i_] :=
g[ f[1] /* ## & @@ Array[g@*f, i - 1, 2] ]
Array[fn[f, g, #] &, 4] // Column
g[f[1]] g[f[1] /* g[f[2]]] g[f[1] /* g[f[2]] /* g[f[3]]] g[f[1] /* g[f[2]] /* g[f[3]] /* g[f[4]]]
Oops, it seems this is a solution to a typo rather than what you actually need.
Responding to your comment for a solution to your variation:
fn[n_] := Fold[f[#2] /* g[#] &, f[n], Range[n - 1, 1, -1]]
Array[fn, 5] // Column
f[1] f[1] /* g[f[2]] f[1] /* g[f[2] /* g[f[3]]] f[1] /* g[f[2] /* g[f[3] /* g[f[4]]]] f[1] /* g[f[2] /* g[f[3] /* g[f[4] /* g[f[5]]]]]
Array[g@*fn, 5] // Column
g[f[1]] g[f[1] /* g[f[2]]] g[f[1] /* g[f[2] /* g[f[3]]]] g[f[1] /* g[f[2] /* g[f[3] /* g[f[4]]]]] g[f[1] /* g[f[2] /* g[f[3] /* g[f[4] /* g[f[5]]]]]]