There are portraits of all the headmasters in Hogwarts, why are they no portraits of the founders of the school? If there are, why didn't they sort the first year students into groups instead of the sorting hat?
First, if there are portraits of the founders, why do they not sort students? There are several reasons.
The portraits are not the founders
The portrait of a wizard is not the original. From Pottermore:
A portrait knows little if anything of its subject's life, and therefore could not hold a very interesting conversation about its subject. The exception to this is of the portraits of Hogwarts headmasters, which are kept in a cupboard from the time of their painting, which is usually very old, until the subject dies.The headmaster can therefore teach their portrait to act and speak like them so that they can teach their successors.
Also note that
The subject of a magical portrait is sentient due to enchantments placed on the portrait by the painter.The portrait will be able to use some of the subject's favourite phrases and imitate their general demeanour based on how the subject appears to the painter; however, they are limited in what they can say or do.
If the founders of Hogwarts had created portraits of themselves, and taught them many of their mannerisms from an early period, they would have had many of the qualities of the individuals whom they depicted. Certainly they would be familiar with "their" lives, since the founders would have taught the portraits enough to appear to be them. They certainly could serve as a useful source of counsel.
However, the portraits simply would not have all the qualities of the founders. There is no guarantee that Ravenclaw's portrait would be clever, Hufflepuff's as accepting as she was, or Slytherin's as cunning. Also, unlike the Sorting Hat or indeed the original founders, portraits are possibly limited in how much they can grow. Note that the demeanor of the portrait is explicitly said to depend on how the subject appeared to the painter. This statement might mean that the demeanor, and by extension personality of the portrait, is somewhat fixed. So if the portraits were frozen, imperfect snapshots of the founders, they might not have been nearly as useful for sorting as the originals.
The Sorting Hat is unbiased
The Hat seems to have two goals: to correctly sort students, and to accept their individual choices. As noted by Mike Edenfield in the comments, the founders have their own motivations, not having been created and enchanted for the specific task of sorting students, and would likely disagree as to who can be sorted. In the past, of course, they showed sufficiently little inclination to work together that Slytherin left the school.
More than this, the Sorting Hat actually employs criteria different from (and indeed, to some extent superior to) those the founders would have considered, particularly in the case of Slytherin and Hufflepuff Houses.
Recall that in Harry Potter and the Order of the Phoenix, we are told the standards that the founders had for admission to Hogwarts:
Said Slytherin, “We’ll teach just those
Whose ancestry is purest.”
“We’ll teach those whose intelligence is surest.”
Said Gryffindor, “We’ll teach all those
With brave deeds to their name,”
Said Hufflepuff, “I’ll teach the lot,
And treat them just the same.”
Note how much the Sorting Hat diverges from the standard set by the founders! Rather than implementing Slytherin's original, biased decision, the Hat sorts people into Slytherin if they have the attributes prized by Salazar Slytherin himself, namely cunning and ambition. Rather than simply lumping "the rest" into Hufflepuff, as indeed many still think it does, the Hat sorts those whose defining qualities are kindness and loyalty, those prized by Hufflepuff herself, who would take on any students whom she could. Indeed, even Gryffindor seems to take on brave people, not those who already have great accomplishments (with one or two notable exceptions). Then, too, the Hat diverges by letting people choose their Houses, which may not have been the case in the founders' day.
The hat can read the minds of students
There is also the small matter of the hat being rather good at reading people's thoughts and feelings, which of course gives it a rather large advantage in determining where students belong. While the founders of Hogwarts may well have been sufficiently skilled at Legilimency to sort students correctly, their portraits are manifestly incapable of the same.
But why are there no portraits of the founders at Hogwarts?
Well, there are three reasons...
Slytherin left the school after a falling-out with the others. Further, as we saw, he apparently preferred enormous statues and lethal thousand-year-old serpentine murder machines when it came to preserving his legacy.
The founders were not headmasters
It quite likely that the tradition of having portraits started with the headmasters, which the founders explicitly were not. In any case, a portrait, not being oneself, does not bestow immortality; the main advantages are to those who might benefit from the advice of the portraits' residents.
They wouldn't want them!
Hufflepuff would have been far too humble to want a portrait. Probably the same would be true of Gryffindor. Slytherin would not, but he left the school and would probably be denied an official portrait. Ravenclaw might have, but who can say?
Hogwarts was founded over a thousand years ago. Portraits weren't often painted that long ago, and even if one was, they are very unlikely to have survived to contemporary times.
The portraits in Hogwarts are very likely framed oil or watercolor paintings on canvas. They are definitely not murals (painted directly on walls), because they are described repeatedly as having frames. Harry Potter and the Prisoner of Azkaban chapter 6 describes the portrait of Sir Cadogan as “a large painting of a bare stretch of grass hanging on the stone wall”. The same place also explains that such framed paintings are common in Hogwarts.
Harry was used to the subjects of Hogwarts paintings moving around and leaving their frames to visit each other, but he always enjoyed watching them.
In chapter 9, when the painting of the Fat Lady on the entrance hole of the Gryffindor Common Room is destroyed, the description is.
The Fat Lady has vanished from her portrait, which had been slashed so viciously that strips of canvas littered the floor; great chunks of it had been torn away completely.
Dumbledore took one quick look at the ruined painting […]
Another description I could find is in Deathly Hallows chapter 28 about the portrait of Ariana Dumbledore in the Hog's Head pub:
The stairs opened on to a sitting room with a threadbare carpet and a small fireplace, above which hung a single large oil painting of a blonde girl who gazed out at the room with a kind of vacant sweetness.
A thousand years ago, it wasn't yet common for European nobleman to have their portraits painted. I'm not very good in history, but I believe that practice started only during the Renaissance.
Salazar Slytherin has a giant stone statue in the Chamber of Secrets though, as we learn from Chamber of Secrets chapter 17.
Based on wikipedia, images were first captured in 1800s. World's earliest surviving camera photograph is from 1826 or 1827.
The history of photography has roots in remote antiquity with the discovery of the principle of the camera obscura and the observation that some substances are visibly altered by exposure to light. As far as is known, nobody thought of bringing these two phenomena together to capture camera images in permanent form until around 1800.
Since Hogwarts was formed thousand years ago.
You all know, of course, that Hogwarts was founded over a thousand years ago – the precise date is uncertain – by the four greatest witches and wizards of the age.
Harry Potter and the Chamber of Secrets, Chapter 9, The Writing on the Wall
It is possible that camera or some other form of photography were available during the times of the founders of Hogwarts. But J. K. Rowling decided to use the hat because it felt right to her.
The Sorting Hat does not appear in my earliest plans for Hogwarts. I debated several different methods for sorting students (because I knew from early on that there would be four houses, all with very different qualities). The first was an elaborate, Heath Robinson-ish machine that did all kinds of magical things before reaching a decision, but I did not like it: it felt at once too complicated, and too easy. Next I placed four statues of the four founders in the Entrance Hall, which came alive and selected students from the throng in front of them while the school watched. This was better, but still not quite right. Finally, I wrote a list of the ways in which people can be chosen: eeny meeny miny mo, short straws, chosen by team captains, names out of a hat - names out of a talking hat - putting on a hat - the Sorting Hat.