As long as you realize that you have some knowledge, just saying the words is not necessarily bad.
Are you talking about saying “I don’t know” verbally or mentally (ie to yourself)? Verbally, it is often the most efficient way to communicate some information. Mentally, it is usually good to explicitly think of what your ignorance prior is. If you have to act on the (lack of) knowledge, at least think of what possibilities are or are not permitted by the evidence. Of course, it is often better to ask someone than to examine your ignorance prior in detail, depending on the situation.
As long as you realize that you have some knowledge, just saying the words is not necessarily bad.
Are you talking about saying “I don’t know” verbally or mentally (ie to yourself)? Verbally, it is often the most efficient way to communicate some information. Mentally, it is usually good to explicitly think of what your ignorance prior is. If you have to act on the (lack of) knowledge, at least think of what possibilities are or are not permitted by the evidence. Of course, it is often better to ask someone than to examine your ignorance prior in detail, depending on the situation.