gf^n=(gf)^n trivially implies gff=gfgf. gff=gfgf implies gf^3=(gff)f=(gfgf)f=gf(gff)=gf(gfgf)=(gf)^3, and analogously for all n. Therefore you can summarize your property as gff=gfgf.
I suspect you discovered this property by studying specific g,f. ff=fgf implies gff=g(ff)=g(fgf)=gfgf. Therefore I suggest you check whether your g,f satisfy the stronger ff=fgf, which looks like a more natural property.
Equivalently, gfgf=gff. Do you even have fgf=ff?
That is, admittedly, a bit terse for me. Could you elaborate?
gf^n=(gf)^n trivially implies gff=gfgf. gff=gfgf implies gf^3=(gff)f=(gfgf)f=gf(gff)=gf(gfgf)=(gf)^3, and analogously for all n. Therefore you can summarize your property as gff=gfgf.
I suspect you discovered this property by studying specific g,f. ff=fgf implies gff=g(ff)=g(fgf)=gfgf. Therefore I suggest you check whether your g,f satisfy the stronger ff=fgf, which looks like a more natural property.