Old carpet padding can be reused if it's not torn or doesn't have any smells or things soaked into it.
However I would recommend just laying down fresh carpet padding and get rid of the old carpet padding because the carpet padding can break down and make the carpet that you installed newly not feel as soft or good.
I would never reuse carpet padding myself if I'm going through all the work to remove the old carpet and then install new carpet.
However if you need new carpet and cannot afford new carpet padding then installing the new carpet on the old carpet padding is okay.
Just make sure the old carpet padding is in good shape and doesn't have anything bad on it that could cause odors with your new carpet.
You could steam clean the carpet padding if you need too but it's easier to just throw out the old carpet padding and install new carpet padding.