I am looking for a function $f:[0,1]\rightarrow \mathbb{R}$ which is not Riemann integrable such that $$\sum_{k=0}^n |f(x_k)-f(x_{k-1})|^2 <1$$ for every choice of $0=x_0\le x_1 \le \cdots \le x_n =1$
I tried the function
$$f(x)= \begin{cases} 0 , x \in \mathbb{Q}\\ x^2 , x \in \mathbb{Q} ^c \end{cases}$$
Does this function satisfy the given condition? I tried many choices of partitions for this function and it seems to satisfy the given condition. I couldn't get a contradiction in any of those cases. Can anyone help to prove or disprove the existence of such function?Thank you.