We said we were discussing (a) certain matter then.
The sentence with/without the indefinite article "a" before the word "matter" is grammatically correct, depending on the sense the word matter is used. "Matter" is used both as a countable noun and uncountable noun.
When you use it as a countable noun to refer to a situation or subject someone needs to deal with, you should use "a" before it.
On the other hand, when you use "matter" as an uncountable noun in the sense of substance, material, it doesn't need "a" before it such as we discussed certain printing matter.