I figured it out. The sin(1/x) integral does not exist and the integral of the square does?
I'm looking for the example of a function f:[0,1]->R that is not integrable on [0,1] but the square of the function is.
I've tried 1/x and lnx and e^x and a bunch of others, I'm thinking it could have something to do with a transformation of (-x^3) then when it's squared the function is x^6, but I'm not sure if this is the right track. Any ideas?
As girdav noted, it matters whether we're talking Riemann or Lebesgue. The rational/irrational function above is Lebesgue integrable. Think about the harmonic series to find a function not Lebesgue integrable but whose square is.