This question is a continuation of this one.
I used the answer provided in the previous question to write this code
g[f_][x_?NumericQ] := If[EvenQ@Floor[x], f@FractionalPart[x], 1/f@FractionalPart[x]]
for an arbitrary pure function $f$. It works for many things but it cannot be integrated or differentiated properly. One example: this code
Integrate[g[1 + Sin[Pi #] &][x], {x, 0, 2}]
stay unevaluated. If I use instead NIntegrate I can get a numerical result. But Im interested in the symbolic result. In the same way this code
g[1 + Sin[Pi #] &]'[3]
stay unevaluated. Of course this code doesnt work also
Plot[D[g[1 + Sin[Pi #] &][x], x], {x, 0, 2}, Exclusions -> {Sin[2 Pi x] == 0}]
In short: I dont know how to differentiate or integrate these operated functions. Some help will be appreciated.