Dumbledore's portrait was in the headmaster’s office, Harry could have interacted with it. McGonagall would have allowed him private conversations with it if necessary. Even if it was just an imprint, it would have been a powerful guide to Harry, answering any questions he might have had... but we don't see this, and instead Harry just struggles with himself over whether the Hallows really exist and if they're worth pursuing over the Horcruxes... do you think JKR forgot about this possibility?
He wanted Harry to find out slowly - and couldn’t leave Hogwarts.
Phineas Nigellus Black explained to Harry that people in portraits can only visit other portraits in the same building that their portraits are in, or other portraits of them (and the portraits in that building).
“Professor Dumbledore’s portrait – couldn’t you bring him along, here, into yours?’
Phineas Nigellus turned his face in the direction of Harry’s voice.
‘Evidently it is not only Muggle-borns who are ignorant, Potter. The portraits of Hogwarts may commune with each other, but they cannot travel outside the castle except to visit a painting of themselves hanging elsewhere. Dumbledore cannot come here with me, and after the treatment I have received at your hands, I can assure you that I shall not be making a return visit!”
- Harry Potter and the Deathly Hallows, Chapter 15 (The Goblin’s Revenge)
Dumbledore would therefore only be able to visit places with a portrait of him. The one at Hogwarts was probably the only one that existed at the time, so Harry would then only be able to visit him at Hogwarts. (Going to Hogwarts while it was controlled by Death Eaters would of course have been risky - Harry only went when he absolutely had to in looking for the Horcruxes.)
Dumbledore also actively didn’t want to tell Harry everything he needed to know all at once. He wanted Harry to find out about the Hallows slowly, so he’d have more time to develop wisdom and hopefully not be tempted by the prospect of the Hallows, as Dumbledore himself had once been.
“Why did you have to make it so difficult?’
Dumbledore’s smile was tremulous.
‘I am afraid I counted on Miss Granger to slow you up, Harry. I was afraid that your hot head might dominate your good heart. I was scared that, if presented outright with the facts about those tempting objects, you might seize the Hallows as I did, at the wrong time, for the wrong reasons. If you laid hands on them, I wanted you to possess them safely.”
- Harry Potter and the Deathly Hallows, Chapter 35 (King’s Cross)
That’s why he gave Harry the information about them in such an indirect way, leaving a copy of The Tales of Beedle the Bard for Hermione, rather than a more straightforward way of letting Harry know about them. Even if Harry had talked to his portrait, Dumbledore might not have told him, because it was part of his plan that Harry wouldn’t find out about everything all at once.
In addition, J.K. Rowling addresses this in an interview from both in-universe and out-of universe perspectives. In-universe, the explanation is exactly as laid out in the information in the books. Dumbledore wanted Harry to find out about the Hallows slowly so he’d have more time to gain the wisdom not to be tempted, and also couldn’t leave his portrait at Hogwarts - wizards in paintings can only go to other places where there was a painting of them or paintings in the same building.
Q: Why couldn’t Harry speak to a portrait of Dumbledore throughout the last book?
Well there are two reasons, three reasons actually… The last bit, why did he have to decode? As Dumbledore says to Harry…to tell Harry about the Hallows was to tempt him. And Harry, throughout all seven books has been incredibly impetuous and reckless. That’s one of Harry’s biggest flaws. He does tend to act without thinking, and Dumbledore knows this about Harry. He wants him to work it out slowly enough to gain wisdom along the way. That’s why he passed the information through Hermione, who is the most cautious person in the books, as you know. And Dumbledore says explicitly, so your good heart isn’t overcome by your hot head. Or I may have paraphrased myself slight there so forgive me. “She doesn’t even know her own book!” [laughter] Yes so that’s one reason. Harry needs to decode. He said, he does say in this book, he’s frightened by his decision not to race for the wand, because he had never chosen not to act. So that’s Harry’s real big coming of age moment, that he’s decided to hold back for the first time very in his life.
So the other two reasons that I have for him not to speak to Dumbledore’s portrait, first of all, I crated a lot of rules for this world and then later had to navigate my way around them. But this rule was always good, and the rule was that portraits could only move between portraits in the same building. so if I’m in a picture and you’re in a picture and we’re both in Carnegie Hall, then we can move into each other’s pictures. Otherwise we can only move only to other places where we have a portrait. You can’t just move willy nilly through all the – the Louvre, the Met – you can’t do a world tour, as a picture person. You are limited by geography. So there was that reason. And then lastly of course, the third reason, is it really would be too easy and I wouldn’t have had a plot.
- Carnegie Hall interview (October 20, 2007)
Out-of-universe, she says it would have been too easy for Harry and there’d be no plot. However, in this case the events do make sense in-universe, and it is consistent with what we know of the world and its characters. It’s also supported by evidence in the books, not just an after-the-fact statement.
Hogwarts was under Death Eater control for a majority of Deathly Hallows, so it was somewhat impractical to go there to talk to the portrait, especially while Snape was the headmaster, and keeping Harry hidden was a large priority of the Order at the start of the book - traveling to Hogwarts would not have been a good thing to keep him hidden.
At the end of Half Blood Prince most of characters are rather distressed about Dumbeldore's death, so it would be an understandable thing to not think of that.
That's a question I've wondered about before, but I doubt JKR forgot the possibility. I think it more likely that she chose not to use it as it would have removed the need for Harry to discover the information on his own, which makes the revelations in the last book that more dramatic (and pads out that book somewhat :) ). Allowing the portrait to explain everything would have taken up, at most, one chapter, and would have been a huge amount of exposition to take in. Having Harry learn about the hallows & how to destroy horcruxes on his own allowed more character development and more action to take place in the narrative, which I think made the last book that much more interesting of a read.
Also, the portrait doesn't necessarily have a full set of Dumbledore's memories, does it? (any canon references for this welcome!). I'm not sure how JKR envisioned the headmaster's portraits in their knowledge of their former selves, but I doubt they would have all their knowledge/memories.
And also: apart from at the end of book 6 (Half-blood Prince), between Dumbledore's death and all the students going home, Harry had very little time to spend in the headmaster's office. He then didn't return to Hogwarts until the end of book 7 (Deathly Hallows), by which point he'd already figured out everything.
It was not necessary.
The majority of Half-Blood Prince was about Dumbledore giving Harry all the knowledge about Voldemort he'd accumulated, minus the bit about Harry being a Horcrux.
Dumbledore's memories from the Pensieve, getting Harry to retrieve the memory from Slughorn, how Horcruxes require a death to be created, and culminating with an excursion to show Harry just how well protected the Horcruxes are - and giving Harry the goal to figure out what the remaining ones are, and to destroy them.
Harry had a path, and there was no more knowledge necessary (that was known only to Dumbledore, at least) to carry it out.