You really have only three options...
- Developing structural iridescence
- Lose hair and develop brightly colored patches of skin
- Symbiosis with algae or other single-celled organisms
Background to the problem
Your problem all stems from one central issue: mammalian hair is dead keratinized tissue (though the follicles are alive) and the only pigments mammals are capable of expressing in them are eumelanin and pheomelanin. Eumelanin makes brown and black pigments and pheomelanin makes red and yellow ones. Most vertebrates are incapable of making blue pigment (which you also need to make green pigment because yellow + blue = green) and those that are blue or green achieve this in different ways.
Structural Iridescence
The way most blue and green vertebrates achieve their coloration is through structural iridescence of the skin, scales, or feathers. This can produce a blue coloration, and combined with yellow carotenoid pigments can be used to create green. The problem with this, however, is that structural iridescence is really something mammalian hair can't do due to the way it is microstructurally organized. Blue and green coloration in birds seems to be linked to the way bird feathers develop (which is different from how mammal hair develops) and are capable of forming complex cross-linking structures, while mammal hair is relatively plain. I remember reading that it was related to how bird feathers are able to cross-link, but I'm not entirely sure and I don't have said reference in front of me. The basic gist of the argument is that feathers, scales, and skin are complex three-dimensional structures that can be microscopically shaped to form different nanoscale structure because of their three-dimensionality. Mammal hair is basically a stick of keratin jutting out of a gland and doesn't have a lot of ways it can be shaped.
Losing Hair and Developing Brightly Colored Patches of Skin
An alternative would be to have the animal lose its hair and instead develop brightly colored patches of skin. This is what the only mammals with truly blue coloration (not grey-blue), primates such as mandrills, do. Because skin is living tissue it is possible to make more complex colors with bare mammalian skin than hair tissue.
A potential runner-up, but unlikely solution, is to allow the animal to get coloration from something it eats. I say unlikely because most of the time animals assimilate color from their food it tends to be red and yellow carotenoids, and most of the time those animals seem to be insectivores (at least the ones with bright colors). Notably, eating green plants would not allow an animal to assimilate the chlorophyll and become green, because chlorophyll does not survive digestion.
Another problem on top of this is that most mammals, with the exception of primates and certain marsupials, are dichromats, they cannot see the color red. As a result, the way they tend to see the world is washed out and from their perspective there isn't much difference between brown and green or blue because the red is missing. This is how many mammals can hide from other mammalian predators/prey despite being a very noticeable brown on a green backdrop: to a dichromat there is no difference between the two. This means there is likely to be very little selection for bright green and blue coloration because two of the primary drivers for color changes, sexual selection and camouflage, are not going to have any meaning. It's worth noting that the only mammals which have bright blue or green coloration are all primates, which can see in color.
Symbiosis with algae
This is what tree sloths do. Their hair has special grooves in it that algae grow in that make them appear green. It's thought that this makes for better camouflage against harpy eagles, which can see in color, compared to mammalian predators which cannot tell the difference between green and red-brown. This is probably the most realistic option on the list.