One usually knows if one has done their penance. Just as one usually knows if say they took their medicine that day. But it could happen that one may forget. So one can simply repeat the penance.
Not always so clear in that one penance I was given a book to read and I did read it and the priest had plenty of proof I worked my way through it… etc but it is much harder carrying out what the book basically telling me of which I often forget. Now was the penance simply to read the book or was the penance to do what was in the book I do try, still try when I err remember. From the Anglican perspective or at least from my own perspective with that priest between us I know what he will say without asking but which is the penance, reading the book or doing the book. He didn’t say, just talked about the author when he gave me the book. So knowing whether you have done your penance isn’t so straight forward if this had been given in a Catholic Confession. But I do faithfully try when I remember and it is part of the journey in a way… but just to highlight not so easy to know whether you done it or not. If in doubt if possible go back to Confession with the Priest who set it and ask them.
Now I will note for those out there that who struggle with scruples --that their doubt may be unreasonable. If they genuinely do not know if they did the penance they too could simply do it. But it can happen with some that they will start fretting about if they did it right …or if that was really 5 Our Fathers that they prayed or was it maybe only 4 and they will start all over again…and then worry was I distracted there…and start all over again…they need a regular confessor to assist them with their scruples. They ought not scruple over their penance…even if they got distracted a moment …they still did their penance. They can often be instructed not to repeat such unless they know that it was not done (then it is not repeating

)