Up and down, up and down
R, 58 54 50 48 43 bytes

-2 bytes thanks to MickyT



function(n)diffinv(rep(1:n%%2*2-1,1:n*2-1))


Try it online!

function(n)
 diffinv(                           # take cumulative sum, starting at 0 of
             1:n%%2*2-1,            # a vector of alternating 1,-1
         rep(                       # repeated
                        1:n*2-1))   # 1, 3, 5, etc. times