Take, for instance
f(x) = - x^2
(you know the notation x^2 ? It means x squared, also known as x times x). You should be able to verify (without using Mathematica) that this function satisfies your condition. Otherwise you are in the wrong course.
Hi there!
Thanks for the answer, but I'm not exactly sure what to do with those lines. I copied it into the Wolfram search bar and got a page up, would the answer to my question be the diffrential equation solution? The reason I'm asking is the fact that I can't actually write it like that in the online course I'm taking and I need a "normal" function and I don't know how to begin making one.
One way is with DSolveValue:
DSolveValue[{f'[x] == Piecewise[{{1, -1 < x < 0}, {-1, 0 <= x < 1}}], f[0] == 0}, f[x], x] Plot[%, {x, -2, 2}]