I would think that God never fails to respond to prayer; He just doesn’t always grant our requests or, even when He does, He does so (at least sometimes) in ways we don’t overtly expect or imagine.
Requests (the form which petitionary prayer [probably the most commonly uttered of all prayer-forms] takes) - almost by definition - can be refused or rejected. More often than not, I suspect, He does this for our own sakes, given the incredulity and outright foolishness of what we on occasion ask for (cf. Jas 4:3)
Prayer is personal event/action. The more you know a person, the more you will be familiar with certain patterns of said person’s responses. This is not to remove the element of mystery on occasion, but it does emphasize that if confusion occurs on a regular basis, it’s probably wise to investigate the quality of the relationship (how much we know the person and how often we’ve been ‘in touch’ with him/her) instead of questioning whether a relationship existed at all.
I doubt it’s likely we could ever know for sure. Within a personal context, where an agent is presumed to be at ‘the other end of the line’, the question wouldn’t apply. The presence of a person being attentive to our requests simple cannot be judged by whether or not a requested item/event ‘occurred’. As mentioned, a denial of our requests may STILL qualify as a ‘personal response’.
Remember that the act of petition presupposes a personal loving God, a presupposition which settles what the question seeks to throw into doubt i.e. the existence of a personal God.
This question contains the assumption that there is no other influence on divine providence APART from God’s foreknowledge of our needs. But this is unwarranted.
If personal relationships are the most valuable thing to God, then it is at least possible that He may make the occurrence of events/blessings/solution/etc. contingent upon our requests. His providence is thereby a function (at least partially) of the quality of our fellowship with Him. Again, “You have not, because you ask not.” (Jas 4:2). The asking could mean more to God than we imagine…
Furthermore, in a community context, a failure to pray could result in culpability on our part (just like we cannot be completely innocent if we abandon and not help suffering people). Our prayers could be the divinely ordained means to impact society for good.
Prayer, then, is not only the expression of an on-going and on-growing love with our Heavenly Father, but also a responsibility we have towards blessing each other.