Where can you use “and/or”?

Solution 1:

The Chicago Manual of Style [section 5.220] has this to say:

and/or. Avoid this Janus-faced term. It can often be replaced by and or or with no loss in meaning. Where it seems needed [take a sleeping pill and/or a warm drink], try or . . . or both [take a sleeping pill or a warm drink or both]. But think of other possibilities [take a sleeping pill with a warm drink].

There are always more graceful ways to phrase a sentence without resorting to and/or.

Solution 2:

It's appropriate in a technical or legal context (which would often be a type of formal context), where the precision of indicating that you mean "X or Y or (X and Y)" is desirable.

"X or Y" can be validly interpreted as "X or Y or (X and Y)" or as "X or Y but not (X and Y)". Mostly we get by judging which is meant from context, but in legal and technical contexts such misinterpretation could be costly, if not disastrous.

Such contexts also tend to be explicit in the other direction - if they mean "X or Y but not both" they will make sure to include that "...but not both". They may also emphasis an either and an or with bolding or similar.

Such contexts are "formal" by some standards, but different to some other types of formal prose, in which it should probably not be used. This can include different passages in the same work: It may be appropriate in an item list giving a break-down of a process, but not appropriate in accompanying paragraphs.

In informal use, you can of course do whatever you want. Such use would be rather slangy, and like all slang some people will like it and some will not.