If you realize during the Salah that you forgot to recite Tashahhud, your Salah is valid but you need to recite the Tashahhud immediately after Salah before saying any word.
If you realised that mistake after doing something else, your Salah is valid.
Tashahhud is obligatory but it is not Rokn. Rokn is the most important obligatory with out which Salah is invalid. Forgetting Tashahhud does not invalidate the Salah.