Merging water softener drain line to water heater relief valve drain line
The down pipe from your water heater relief valve should not be plumbed into a drain.  the output end may be hovering over a floor drain but not hard plumbed to drain lines.  If the relief blows off due to high pressure (possibly steam) it could rupture a hard plumbed drain line.

There are two drain lines from a water softener; one over-flo from the brine tank and one off the control valve.  The over-flo line could go to the same place as the heater relief output.  The line from the control valve will have a significant pressure while the softener is in recharge or backwash modes and should be hard plumbed through a check valve to your drain piping to sewer or septic.